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

googlecloudpubsubreceiver: Accept Cloud Logging logs routed to pub/sub #23184

Closed
kamalmarhubi opened this issue Jun 6, 2023 · 13 comments
Closed

Comments

@kamalmarhubi
Copy link
Contributor

kamalmarhubi commented Jun 6, 2023

Component(s)

receiver/googlecloudpubsub

Is your feature request related to a problem? Please describe.

There are logs in GCP that we'd like in our OpenTelemetry pipeline. GCP's supported way to send logs to other destinations in near real-time is via Pub/Sub. Logs are encoded as LogEntry messages in protojson format.

Our immediate use case: so that our traces cover as much of the request path as possible, we want to include Google Cloud Load Balancer (GCLB) spans. GCP doesn't have an obvious way to get spans out of the GCLB, but it does have a way to log all requests. So, we currently process GCLB logs into spans. We've routed our GCLB logs to a Pub/Sub topic, and at the moment process those into spans using a custom consumer that exports spans to our otelcol deployment.

I'd like to remove that custom component, and replace it with the OpenTelemetry Collector using the logtospanconnector proposed in #23182 (whether upstreadmed or not).

But the problem of accepting logs from GCP into an OpenTelemetry pipeline is a lot more general than my precise use case though. For example, one might want to have AuditLog events flow through their unified pipeline.

There's already a googlecloudpubsubreceiver, but it seems designed to use Pub/Sub as a message queue to between collector deployments. I'd like to extend it to be an entrypoint for Cloud Logging logs too.

Describe the solution you'd like

I'd like to be able to specify cloud_logging as an encoding for the receiver.

Describe alternatives you've considered

We've already done most of the work for this, so we'd likely shift our current use case over to a custom build of the collector if this or something similar doesn't get upstreamed.

Additional context

Doing this correctly probably needs a bit more work on the resource semantic conventions for GCP.

I'm open to this being a new receiver, but given that the existing receiver exists and has multiple encodings, I figured it wasn't worth duplication of the PubSub subscriber code.

@kamalmarhubi kamalmarhubi added enhancement New feature or request needs triage New item requiring triage labels Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

  • receiver/googlecloudpubsub: @alexvanboxel
  • needs: Github issue template generation code needs this to generate the corresponding labels.

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Aug 7, 2023
@alexvanboxel
Copy link
Contributor

Sorry for the delay. I will set aside some time, and shift some attention back to OTel (not stale)

@alexvanboxel
Copy link
Contributor

alexvanboxel commented Aug 7, 2023

@kamalmarhubi could you explain why setting the encoding to otlp_proto_log doesn't suite your use-case? see: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/googlecloudpubsubreceiver#encoding

@kamalmarhubi
Copy link
Contributor Author

@alexvanboxel the format from GCP when setting up a log sink is not OTLP, it's JSON-encoded LogEntry messages.

I guess the most surprising thing to me about trying with otlp_proto_log is that it doesn't print errors, it just hangs.

Also I should mention that I've implemented this, though am not yet using it in production, and it would need some tidying before it could be merged. I've pushed up a draft in #25175 for you to look at whenever you have time. (I'm about to be on vacation for a couple of weeks, so no rush!)

@alexvanboxel
Copy link
Contributor

Okay, it's been a while; I meant the raw_text; having this in the receiver makes sense. Let me investigate (I'll have a look at your draft)

@kamalmarhubi
Copy link
Contributor Author

@alexvanboxel have you had a chance to take a peek?

@alexvanboxel
Copy link
Contributor

Adding comment on the PR

kamalmarhubi added a commit to kamalmarhubi/opentelemetry-collector-contrib that referenced this issue Oct 8, 2023
Add a new `cloud_logging` encoding, which allows the receiver to
consume messages from a Pub/Sub topic that's used as the destination
of a Cloud Logging sink.

refs open-telemetry#23184
@crobert-1 crobert-1 removed the needs triage New item requiring triage label Oct 9, 2023
@alexvanboxel
Copy link
Contributor

Follow along open-telemetry/opentelemetry-specification#3774 for making sure the receiver aligns with the description.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 19, 2024
alexvanboxel added a commit to alexvanboxel/opentelemetry-collector-contrib that referenced this issue Feb 1, 2024
This commit addresses the need to accept logs from Google Cloud Platform
into an OpenTelemetry pipeline. The goal is to introduce the
`cloud_logging` encoding option for the receiver, allowing users to
seamlessly integrate Cloud Logging logs into their OpenTelemetry
pipeline.

issue open-telemetry#23184

Co-authored-by: Alex Van Boxel <alex@vanboxel.be>
djaglowski pushed a commit that referenced this issue Feb 1, 2024
**Description:** 
This commit addresses the need to accept logs from Google Cloud Platform
into an OpenTelemetry pipeline. The goal is to introduce the
`cloud_logging` encoding option for the receiver, allowing users to
seamlessly integrate Cloud Logging logs into their OpenTelemetry
pipeline.

**Link to tracking Issue:**
#23184

**Testing:**
Added tests for parsing LogEntries

**Documentation:**
Added the option to the README.md

Co-authored-by: Kamal Al Marhubi <kamal@wave.com>
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Feb 1, 2024
…etry#29299)

**Description:** 
This commit addresses the need to accept logs from Google Cloud Platform
into an OpenTelemetry pipeline. The goal is to introduce the
`cloud_logging` encoding option for the receiver, allowing users to
seamlessly integrate Cloud Logging logs into their OpenTelemetry
pipeline.

**Link to tracking Issue:**
open-telemetry#23184

**Testing:**
Added tests for parsing LogEntries

**Documentation:**
Added the option to the README.md

Co-authored-by: Kamal Al Marhubi <kamal@wave.com>
@alexvanboxel
Copy link
Contributor

Thank you, @djaglowski, for merging the issue. This related ticket can be closed.

@github-actions github-actions bot removed the Stale label Feb 3, 2024
Copy link
Contributor

github-actions bot commented Apr 4, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Apr 4, 2024
@alexvanboxel
Copy link
Contributor

@open-telemetry/collector-contrib-triagers, can this be closed? This has been merged some time ago.

@songy23 songy23 closed this as completed May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants