Skip to content

segment prometheus - does not allow other labels or labels are not documented #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nachtfalkeaw opened this issue Apr 7, 2025 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Nachtfalkeaw
Copy link

Hello,

error:

[root@u999fmlab001l alloy]# ./flowpipeline-linux-static -c config.yml -l "info"
2025/04/07 11:30:07 [info] Goflow: Scheme sflow supported.
2025/04/07 11:30:07 [info] Goflow: Scheme netflow supported.
2025/04/07 11:30:07 [info] Goflow: Configured for for sflow://:6343,netflow://:2055
2025/04/07 11:30:07 [info] Goflow: 'workers' set to default '1'.
2025/04/07 11:30:07 [error] Prometheus: Field 'src_addr' specified in 'labels' does not exist.
2025/04/07 11:30:07 [error] Configured segment 'prometheus' could not be initialized properly, see previous messages.
[root@u999fmlab001l alloy]#

Config:

- segment: goflow
- segment: prometheus
  config:
    endpoint: ":8888"
    labels: "src_addr"
    metricspath: "/metrics"
    flowdatapath: "/flowdata"

I do not see which labels are allowed but found this and it does not seem to work.
https://github.com/BelWue/flowpipeline/blob/master/segments/export/prometheus/prometheus.go

// Collects and serves statistics about flows.
// Configuration options for this segments are:
// The endoint field can be configured:
// <host>:8080/flowdata
// <host>:8080/metrics
// The labels to be exported can be set in the configuration.
// Default labels are:
//
//	router,ipversion,application,protoname,direction,peer,remoteas,remotecountry
//
// Additional Labels are:
//
//	src_port,dst_port,src_ip,dst_ip
//
// The additional label should be used with care, because of infite quantity.

Only the following default labels which are different than in the previous link are working:
https://github.com/BelWue/flowpipeline/blob/master/CONFIGURATION.md#prometheus

@ynHuber
Copy link
Collaborator

ynHuber commented Apr 11, 2025

Hello @Nachtfalkeaw,

all fields defined in the ProtoBuf format are allowed. But not all will be filled. What fields are actually available depends on the input source.
A "list" can be found at

type EnrichedFlow struct {

Thank you for the remark about the outdated documentation. That's something we have to update!

@ynHuber ynHuber added the documentation Improvements or additions to documentation label Apr 14, 2025
@ynHuber ynHuber closed this as completed Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants