Skip to content

Flatten tags in graphite output #13

Description

@eberkut

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 '.'.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions