Skip to content

Add example code for some Opentelemetry implementations#309

Open
Carlosbogo wants to merge 5 commits intomasterfrom
add-otel-examples
Open

Add example code for some Opentelemetry implementations#309
Carlosbogo wants to merge 5 commits intomasterfrom
add-otel-examples

Conversation

@Carlosbogo
Copy link
Contributor

We are writing some toy examples to be used as templates for other teams implementing their Opentelemetry setup for application level monitoring.

Copy link
Collaborator

@vkuznet vkuznet left a comment

Choose a reason for hiding this comment

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

This is great, I really like it. I only made comment about go dependencies resolution. It is minor (but in my view) important change.

1) Go 1.22+
2) From this folder, initialize and fetch dependencies:
go mod init examples/go-otel-toy
go get go.opentelemetry.io/otel@latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not required if you use:

go mod tidy

I rather prefer to teach people more modern way to get dependencies instead of show how to explicitly fetch them. I suggest that you test and adjust documentation accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Valentin, thank you very much for the advice.
I did not know it could work like that, I haven't used Go in quite a while.

I have updated the code with the changes you requested, let me know if there is anything else you think should be updated.

Copy link
Collaborator

@vkuznet vkuznet left a comment

Choose a reason for hiding this comment

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

I would recommend to do two more things:

  • provide README.md describing what is OpenTelemetry, and layout of provided examples (an HTTP server with intrumented telemetry using different Python or GO framework, and a client which can use these metrics)
  • and provide image shapshots of how visually see captured metrics

Also, if you are ambition and have spare time, you can provide a docker file(s) for each server and instructions how to deploy it in local k8s cluster where some OTEL server will collect metrics. And, you can provide description and server how to visualize these metrics and use them for your use-case.

@Carlosbogo
Copy link
Contributor Author

Hi again, Valentin, thanks for the reply.

I will add the README.md now to give some more context, and provide some snapshots of Grafana. In terms of documenting the Grafana setup it might be a bit of a more complicated process, because the setup itself is a bit convoluted.

About the docker image, that would be a good idea, but I would not say that the collector is yet in a production state. This makes me a bit hesitant to add it right now (I think it's a great idea for the future), because there is still some work to be done to ensure that these services produce metrics that are actually collected.

I will look into it and see if it's possible to add that.

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