question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support non-string labels

See original GitHub issue

APM has support for that but in ECS, labels are mapped as keyword

@pgomulka would you need non-string MapMessage values for Elasticsearch?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
felixbarnycommented, Sep 18, 2019

That works with this change: https://github.com/elastic/java-ecs-logging/pull/30

MapMessage supports rendering the message as JSON which EcsLayout is now delegating the rendering to. So you could either use MapMessage, which would render the plain text message slightly differently (key="value"). Or you could create your own class which implements MultiformatMessage (or better MultiFormatStringBuilderFormattable) and which supports a JSON and a plain-text format.

1reaction
pgomulkacommented, Sep 9, 2019

there are some fields that are non string but I format them as strings anyway so that is fine

{"type": "index_indexing_slowlog", "timestamp": "2019-06-24T15:01:11,415-04:00", "level": "WARN", "component": "i.i.s.index", "cluster.name": "esprod", "node.name": "esprod0", "message": "[foo/6cpavWDYRO6pyxezB0LepA]", "took": "3ms", "took_millis": "3", "doc_type": "t", "id": "1", "routing": "", "source": "{\"foo\":\"bar\"}", "cluster.uuid": "b28RGuVmRDimbAkNTVbacg", "node.id": "erxPlzmKQOGUdrDxGrww_g"  }
{"type": "index_indexing_slowlog", "timestamp": "2019-07-09T04:48:28,203-04:00", "level": "WARN", "component": "i.i.s.index", "cluster.name": "es1", "node.name": "es1_1", "message": "[foo/DubP3paOQJCtD1EkUmqxpw]", "took": "2.3ms", "took_millis": "2", "doc_type": "_doc", "id": "1", "source": "{\"foo\":\"bar\"}", "cluster.uuid": "xOp8Gs9TTa-SoSWcs6NZHg", "node.id": "BgSzU7SUTgeRYqzbiyf1sA"  }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for non-string labels · Issue #444 - GitHub
Hello, I haven't found a way to use one representation for x-axis labels and another representation in tooltips.
Read more >
How to handle label names for requests that don't have ...
But the solution is to pass the label values as empty strings or with a hyphen placeholder like Brian Candler suggests. Prometheus will...
Read more >
Labels - Go Packages
MatchLabels returns a subset of Labels that matches/does not match with the provided label names based on the 'on' boolean.
Read more >
Metric and label naming - Prometheus.io
Do not put the label names in the metric name, as this introduces redundancy and will cause confusion if the respective labels are...
Read more >
Log queries | Grafana Loki documentation
The following label matching operators are supported: ... Log line does not contain string; |~ : Log line contains a match to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found