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

Problem in parsing Spring Boot Metrics #16

Closed
udikidron opened this issue Jan 19, 2017 · 3 comments
Closed

Problem in parsing Spring Boot Metrics #16

udikidron opened this issue Jan 19, 2017 · 3 comments

Comments

@udikidron
Copy link

Hi,

I'm trying to use 'httpbeat' in order to sample a spring boot application mertics.
The url I'm sampling is: http://localhost:8080/metrics
The output format is of type: 'json'

The response contains the following JSON:

{"mem":824349,"mem.free":222040,"processors":8,"instance.uptime":11355545,"uptime":9690309,"systemload.average":4.31494140625,"heap.committed":748032,"heap.init":262144,"heap.used":525991,"heap":3728384,"nonheap.committed":78144,"nonheap.init":2496,"nonheap.used":76320,"nonheap":0,"threads.peak":56,"threads.daemon":33,"threads.totalStarted":1398,"threads":37,"classes":8172,"classes.loaded":8242,"classes.unloaded":70,"gc.ps_scavenge.count":14,"gc.ps_scavenge.time":132,"gc.ps_marksweep.count":4,"gc.ps_marksweep.time":612,"counter.status.200.health":343,"counter.status.200.metrics.root":2,"counter.status.200.metrics.name:.-star-":107,"gauge.response.star-star.favicon.ico":19.0,"counter.status.200.star-star.favicon.ico":1,"gauge.response.metrics":2.0,"gauge.response.metrics.root":2.0,"gauge.response.metrics.name:.-star-":1.0,"gauge.response.health":2.0,"counter.status.200.metrics":879,"httpsessions.max":-1,"httpsessions.active":0}

You can see that some of the values in the response contain a dot '.'

While 'httpbeat' tring to send the response to elasticSearch I got the following error:

2017/01/19 16:41:36.714328 client.go:432: WARN Can not index event (status=400): {"type":"mapper_parsing_exception","reason":"Field name [mem.free] cannot contain '.'"}

I assume that I can change the mapping in httpbeat.template.json to make elasticsearch tollerant for this naming confession.

Is it true?
If yes - can you please advise how should I change the mapping?

Thanks!

@christiangalsterer
Copy link
Owner

One way is to set the son_dot_mode and set the value to replace as an additional parameter for the httpbeat, see docs/configuration.asciidoc for an example.

Note: While testing I found a bug when setting the value to 'unflatten'.

@christiangalsterer
Copy link
Owner

There is an interesting discussion on dots in field names in:
elastic/elasticsearch#15951

@udikidron
Copy link
Author

I took your suggestion,
json_dot_mode: replace
And it solved my problem.
Thanks.

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

2 participants