open-telemetry / opentelemetry-demo

This repository contains the OpenTelemetry Astronomy Shop, a microservice-based distributed system intended to illustrate the implementation of OpenTelemetry in a near real-world environment.
https://opentelemetry.io/docs/demo/
Apache License 2.0
1.54k stars 875 forks source link

Add OpenTelemetry Log support to all services #1472

Open puckpuck opened 3 months ago

puckpuck commented 3 months ago

We have converted several but not all services from console output to OpenTelemetry Logs. This is a list of remaining services that need OpenTelmetry log support to be added. This should be accomplished by leveraging an instrumentation library for the existing logging framework or re-writing the console output to leverage an OpenTelemetry LogProvider.

julianocosta89 commented 3 months ago

1433 adds OTLP Logs to Shipping Service (Rust)

Kimbohlovette commented 3 months ago

@puckpuck please assign this issue to me. I have coding experience in Go, Typescript, Python, Javascript so I would complete 80% of this issue without much effort

puckpuck commented 3 months ago

I recommend you do this for 1 service and submit the PR accordingly. It would be great to announce in this thread the service you are working on next.

Kimbohlovette commented 3 months ago

Alright I will do exacly that

Kimbohlovette commented 3 months ago

Hello @puckpuck and everyone here.

Kimbohlovette commented 3 months ago

@puckpuck @jpkrohling please could you look at the PR I opened for the first task? #1477

Kimbohlovette commented 3 months ago
Kimbohlovette commented 3 months ago

@puckpuck @jpkrohling please I have opened a PR for adding otel log support to the checkout service

1478

Kimbohlovette commented 3 months ago
Kimbohlovette commented 3 months ago

@puckpuck @jpkrohling I've opened a PR for Product catalog here #1479 please take a look

Kimbohlovette commented 3 months ago

Hello guys

PR: #1481

Kimbohlovette commented 3 months ago
austinlparker commented 3 months ago

@Kimbohlovette hey, we appreciate your enthusiasm, but you're not actually adding logging support. You're adding a bridge between logging libraries and span events. These aren't the same things. Log support in the Go SDK is currently in development (https://github.com/orgs/open-telemetry/projects/43), so you would need to see if it's in a usable state and if there's any bridges set up for existing Go logging libraries.

Kimbohlovette commented 3 months ago

@Kimbohlovette hey, we appreciate your enthusiasm, but you're not actually adding logging support. You're adding a bridge between logging libraries and span events. These aren't the same things. Log support in the Go SDK is currently in development (https://github.com/orgs/open-telemetry/projects/43), so you would need to see if it's in a usable state and if there's any bridges set up for existing Go logging libraries.

Okay @austinlparker. I will look into that

Kimbohlovette commented 3 months ago

Hello @puckpuck I think there is no work to be done on the loadgenerator service. It is already exporting logs to opentelemetry using OTLPLogExporter from opentelemetry.exporter.otlp.proto.grpc._log_exporter Could some take a look and confirm that?

Kimbohlovette commented 3 months ago

@julianocosta89 @pellared can I work on every go service listed above replacing the logrus with slog while waiting for otelslog log bridge to be ready?

julianocosta89 commented 3 months ago

Hello @Kimbohlovette, according to the OTel Go repo, the logs are still in development: https://github.com/open-telemetry/opentelemetry-go?tab=readme-ov-file#project-status

I wouldn't implement anything yet

pellared commented 1 month ago

@Kimbohlovette, for Go, this issue is unblocked per https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0

You should use the following packages to emit OTel Logs to OTel Collector

You can also look at https://github.com/open-telemetry/opentelemetry-go/pull/5349 for some reference.

julianocosta89 commented 1 month ago

Thanks for the update @pellared!

@Kimbohlovette wanna take it?

Kimbohlovette commented 1 month ago

@julianocosta89 yes I will work on it. @pellared thanks for updates I will start working on it immediately

Kimbohlovette commented 1 month ago

@pellared would you have some time to help me here please? I've used otelslog and otel/sdk/log on the productcatalogservice as in the opentelemetry dice example https://github.com/open-telemetry/opentelemetry-go/pull/5349 but I cannot still see logs emitted on the grafana dashboard. I don't even see logs on the terminal any more. I believe that there is something I'm missing out probably in the way I am defining the loggerProvider or logger. I also believe that if I can figure out how to do it for one I can do the rest.

pellared commented 4 days ago

I've used otelslog and otel/sdk/log on the productcatalogservice as in the opentelemetry dice example https://github.com/open-telemetry/opentelemetry-go/pull/5349 but I cannot still see logs emitted on the grafana dashboard. I don't even see logs on the terminal any more. I believe that there is something I'm missing out probably in the way I am defining the loggerProvider or logger. I also believe that if I can figure out how to do it for one I can do the rest.

@Kimbohlovette, the logs are supposed to be send by the application to the collector using OTLP. You should be able to check if you have the logs in the collector. Otherwise, debug the application. It is hard to help without any code.

Kimbohlovette commented 4 days ago

Okay let me push what I did