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

Add support for egress logs in the Otelcollector client #589

Closed
jriguera opened this issue Jun 18, 2024 · 3 comments
Closed

Add support for egress logs in the Otelcollector client #589

jriguera opened this issue Jun 18, 2024 · 3 comments
Assignees

Comments

@jriguera
Copy link
Contributor

Right now ,there is only support for forwarding envelope metrics to an Otel collector.:

switch e.Message.(type) {
case *loggregator_v2.Envelope_Counter:
c.writeCounter(e)
case *loggregator_v2.Envelope_Gauge:
c.writeGauge(e)
case *loggregator_v2.Envelope_Timer:
c.writeTimer(e)
}

What do you think about adding support for logs?

We are happy to contribute if a PR is welcome.

@ctlong
Copy link
Member

ctlong commented Jun 18, 2024

🙌 We're very happy for support for logs to be added, if you'd like to contribute via PR!

@ctlong
Copy link
Member

ctlong commented Jun 19, 2024

I forgot to mention before, but my preferred solution for getting logs into the OTel Collector would actually be to build a "loggregatorreceiver". See cloudfoundry/otel-collector-release#25.

@jriguera
Copy link
Contributor Author

Oh wow!! Tomorrow I will have a look at your implementation, but it sounds similar to what we are trying to achieve. We already have submitted a PR (accepted) to the OtelCollector codebase cloudfoundryreceiver to read the logs. We are going to do another PR to generate traces from RTR logs.

Because of the amount of logs we have, we would prefer trying an approach similar to what we have in K8S with K8Sobserver/receivercreator running on the local node and gathering (and filtering) app metrics and logs on the same cell (as close as possible where they are generated, in the same node), from there they would be sent to other endpoints. You can also have a look to this other proposal we have got accepted: open-telemetry/opentelemetry-collector-contrib#33618. Eventually, the idea is telling developers to use annotations in their apps, with those annotations we can:

  1. If an app has an specific annotation, scrape all (local) containers to gather app metrics (/metrics endpoint)
  2. If there is another annotation, accept also the application logs.
  3. We can use other annotations to decide tenants or other features .

Apart of that there would be another set of OTEL collectors which would deal with:

  1. RTR logs would be all transformed to traces (and then sampled)
  2. Other logs and platform metrics would be collected with the current cloudfoundryreceiver

For the points 2 and 3 we would need another OTEL processor similar to K8Sattributes processor which would enrich telemetry taking the appid and querying the CF API for extra metadata (we will implement something basic in a second PR for the cfgardenobserver, but eventually all functionality should be in a "CFAttributes processor").

Right now our highest priority is dealing with app metrics and logs in a way which would be really simple for end users (adding annotations to apps) and check if this whole idea performs and works as expected, after that we would think about the "CFAttributes processor" which needs to be properly implemented because of the amount of CF API calls it can generate.

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