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

Debug log incoming lines #58

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

l15k4
Copy link
Contributor

@l15k4 l15k4 commented Sep 10, 2018

For better trouble shooting, see #57

Copy link
Contributor

@matthiasr matthiasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the gitignore change, and add the sign-off to the actual change.

Did you also want to output the final sample?

.gitignore Outdated
@@ -1,5 +1,6 @@
/.build
/.release
/.tarballs
.idea/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not have editor-specific settings in here. You can ignore .idea for yourself in .git/info/exclude (this repository only) or create a global gitignore file for yourself.

@l15k4
Copy link
Contributor Author

l15k4 commented Sep 10, 2018

@matthiasr what do you mean by add the sign-off to the actual change ? I've never used golang so I'm having troubles with outputting the final sample, I don't know how to print it properly. Would you mind supplying that for yourself ?

@matthiasr
Copy link
Contributor

matthiasr commented Sep 10, 2018 via email

Copy link
Contributor

@matthiasr matthiasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the second log line, it looks like this now:

INFO[0000] Starting graphite_exporter (version=, branch=, revision=)  source=main.go:219
INFO[0000] Build context (go=go1.11, user=, date=)       source=main.go:220
INFO[0000] Listening on :9108                            source=main.go:284
DEBU[0034] Incoming line : test_udp 1234 (date +%s)      source=main.go:106
INFO[0034] Invalid part count of 4 in line: test_udp 1234 (date +%s)  source=main.go:109
DEBU[0050] Incoming line : test_udp 1234 1536653140      source=main.go:106
DEBU[0050] Sample: {OriginalName:test_udp Name:test_udp Labels:map[] Help:Graphite metric test_udp Value:1234 Type:2 Timestamp:2018-09-11 08:05:40 +0000 UTC}  source=main.go:146

I still need the sign-off from you.

@matthiasr
Copy link
Contributor

Since you need to rebase for the sign-off anyway, please drop the two commits relating to gitignore. You can do that with git rebase -i.

@l15k4 l15k4 force-pushed the debug-log-incoming-lines branch from ec63498 to fafc343 Compare September 11, 2018 13:40
@l15k4 l15k4 force-pushed the debug-log-incoming-lines branch from fafc343 to dabbb43 Compare September 11, 2018 13:41
@matthiasr
Copy link
Contributor

Thank you!

@matthiasr matthiasr merged commit 15bbc58 into prometheus:master Sep 11, 2018
matthiasr pushed a commit that referenced this pull request Sep 11, 2018
Signed-off-by: Matthias Rampke <[email protected]>
@l15k4
Copy link
Contributor Author

l15k4 commented Sep 13, 2018

@matthiasr sorry for bothering again, but should the debug logging be enabled by adding -log.level=debug flag ? I can see that it uses prometheus log which is a logging wrapper around logrus, so it perhaps should be -log.Level=logrus.DebugLevel but it doesn't work either ...

@l15k4
Copy link
Contributor Author

l15k4 commented Dec 27, 2018

Can pls anybody help how to enable the debug logging ?

@matthiasr
Copy link
Contributor

try --log.level=debug (two dashes)

@l15k4
Copy link
Contributor Author

l15k4 commented Dec 28, 2018

I tried both, the repro is simple :
docker-compose.yml

version: "2"

services:
  graphite-exporter:
    image: prom/graphite-exporter
    ports:
      - "9108:9108"
      - "9109:9109"
      - "9109:9109/udp"
    volumes:
      - ${PWD}/graphite_mapping.conf:/tmp/graphite_mapping.conf
    command: --graphite.mapping-config=/tmp/graphite_mapping.conf --log.level=debug

Then docker exec -it graphiteexporter_graphite-exporter_1 sh

echo "druid.druid/historical.jvm/gc/cpu 56867252 1546008094" | nc -u -w1 localhost 9109
echo "druid.druid/historical.jvm/gc/cpu 56867252 1546008094" | nc localhost 9109

Nothing happens ... what am I missing here, these are the logs :

graphite-exporter_1  | time="2018-12-28T15:50:46Z" level=info msg="Starting graphite_exporter (version=0.3.0, branch=HEAD, revision=4b03941683bd3984b5023ea3fef8e38796cbd2ee)" source="main.go:217" 
graphite-exporter_1  | time="2018-12-28T15:50:46Z" level=info msg="Build context (go=go1.10.3, user=root@2fc574c39d59, date=20180822-07:47:24)" source="main.go:218" 
graphite-exporter_1  | time="2018-12-28T15:50:46Z" level=info msg="Listening on :9108" source="main.go:282" 

However it ends ip in /metrics output, it is just not debug logged :-/

@l15k4
Copy link
Contributor Author

l15k4 commented Dec 28, 2018

omg, my fault, it works if I change to image: prom/graphite-exporter:v0.4.2 ... Sorry

@matthiasr
Copy link
Contributor

matthiasr commented Dec 29, 2018 via email

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

Successfully merging this pull request may close these issues.

2 participants