Skip to content
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

Flatten tags in graphite output #13

Open
eberkut opened this issue Jan 8, 2019 · 0 comments
Open

Flatten tags in graphite output #13

eberkut opened this issue Jan 8, 2019 · 0 comments

Comments

@eberkut
Copy link

eberkut commented Jan 8, 2019

When using the influx output, tags are "flattened" but this is not the case for the graphite output which can create duplicate keys and make the graphite output unusable.

For instance, for a micrometer Java application:

  1. Raw Prometheus output
    logback_events_total{level="error",} 0.0
    logback_events_total{level="warn",} 0.0
    logback_events_total{level="info",} 123.0
    logback_events_total{level="debug",} 0.0
    logback_events_total{level="trace",} 0.0

  2. sensu prometheus collector influx output
    logback_events_total,level=error value=0 1546955856
    logback_events_total,level=warn value=0 1546955856
    logback_events_total,level=info value=124 1546955856
    logback_events_total,level=debug value=2 1546955856
    logback_events_total,level=trace value=0 1546955856

  3. sensu prometheus collector graphite output
    logback_events_total 0 1546954471
    logback_events_total 0 1546954471
    logback_events_total 124 1546954471
    logback_events_total 2 1546954471
    logback_events_total 0 1546954471

To cope with Graphite grammar for metric names compared to influx, multiple tags could be concatenated with '.' (instead of ',' for influx). In addition, '/' could be converted to '_' and '=' to '.'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant