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

[receiver/googlepubsub] Add Google Cloud Logging encoding #29299

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

alexvanboxel
Copy link
Contributor

@alexvanboxel alexvanboxel commented Nov 16, 2023

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

@alexvanboxel alexvanboxel force-pushed the pubsub-cloudlog branch 2 times, most recently from 42c1a0b to 5a628bf Compare November 16, 2023 18:24
alexvanboxel added a commit to alexvanboxel/opentelemetry-specification that referenced this pull request Nov 19, 2023
## Changed

* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload

## Added

* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)

## Why

With this draft PR (open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
alexvanboxel added a commit to alexvanboxel/opentelemetry-specification that referenced this pull request Nov 19, 2023
## Changed

* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload

## Added

* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)

## Why

With this [draft collector PR](open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
alexvanboxel added a commit to alexvanboxel/opentelemetry-specification that referenced this pull request Nov 19, 2023
* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload

* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)

With this [draft collector PR](open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
alexvanboxel added a commit to alexvanboxel/opentelemetry-specification that referenced this pull request Nov 27, 2023
* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload

* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)

With this [draft collector PR](open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
@weyert
Copy link

weyert commented Nov 28, 2023

I would be interested in this functionality too. Any way I could assist?

@alexvanboxel
Copy link
Contributor Author

I would be interested in this functionality too. Any way I could assist?

The PR is ready implementation-wise, but let's see if we agree on the spec first see: open-telemetry/opentelemetry-specification#3775 and open-telemetry/opentelemetry-specification#3774

alexvanboxel added a commit to alexvanboxel/opentelemetry-specification that referenced this pull request Dec 11, 2023
* Clarify that the JSON representation is used for the LogEntry
* Change to Pascal-case for representing the field in LogEntry
* Map MonitoredResource to resource attributes with gcp prefix
* Clarify the type of the Body for jsonPayload, protoPayload, and textPayload

* Mapping section for Severity from Cloud Logging to OpenTelemetry
* Mapping section for Severity from OpenTelemetry to Cloud Logging
* Semantic Mapping section (only includes log.record.uid)
* Clarified that the JSON representation is used for the LogEntry
* Map LogEntryOperation to resource attribute with gcp.operation (KVList)
* Map LogEntrySourceLocation to resource attribute with gcp.source_location (KVList)
* Map LogSplit to resource attribute with gcp.log_split (KVList)

With this [draft collector PR](open-telemetry/opentelemetry-collector-contrib#29299),
the PubsubReceiver will be able to handle the native translation of Google Cloud LogEntry's.
But translations are opinionated. I prefer that we agree on the target mapping before merging
the PR.
@alexvanboxel alexvanboxel force-pushed the pubsub-cloudlog branch 7 times, most recently from 4fab86e to c08836e Compare December 14, 2023 20:36
@alexvanboxel alexvanboxel changed the title [WIP] Add Google Cloud Logging encoding to pubsub receiver [receiver/googlepubsub] Add Google Cloud Logging encoding Dec 15, 2023
@alexvanboxel alexvanboxel marked this pull request as ready for review December 16, 2023 10:03
@alexvanboxel alexvanboxel requested review from a team and atoulme December 16, 2023 10:03
@alexvanboxel
Copy link
Contributor Author

I'm the receiver's CODEOWNER. Note for reviewers: this is mainly an implementation by @kamalmarhubi; I've changed some conversions to match the semconv as much as possible. I had hoped first to add it to the spec, but I will do it the other way around: commit the receiver, then add a note in the spec on compatibility.

@alexvanboxel
Copy link
Contributor Author

@atoulme, I've rebased (so as not to conflict with the new trace/metric imports). Could you give the PR a ready-to-merge? The go.mod file is hard to keep up to date as it contains extra imports.

Copy link
Contributor

github-actions bot commented Jan 5, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 5, 2024
@alexvanboxel alexvanboxel force-pushed the pubsub-cloudlog branch 2 times, most recently from 8338602 to 2654244 Compare January 16, 2024 07:01
@github-actions github-actions bot removed the Stale label Jan 17, 2024
@weyert
Copy link

weyert commented Jan 19, 2024

Lovely! Exciting to try this out to forward Cloud Logging logs via Dataflow to otel-collector :)

@alexvanboxel
Copy link
Contributor Author

Lovely! Exciting to try this out to forward Cloud Logging logs via Dataflow to otel-collector :)

I'll try to fix the merge conflict by next Collector SIG meeting, because it's hard to get momentum on this. BTW, you don't need Dataflow for this, just Log routing.

@weyert
Copy link

weyert commented Feb 1, 2024

Any news on this PR?

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 <[email protected]>
@alexvanboxel
Copy link
Contributor Author

Any news on this PR?

Live is hard as a CODEOWNER without "merge" power. @atoulme or @dashpole can someone with the power merge this?

@atoulme
Copy link
Contributor

atoulme commented Feb 1, 2024

I also cannot merge anything. @open-telemetry/collector-contrib-maintainer can.

@alexvanboxel
Copy link
Contributor Author

I also cannot merge anything. @open-telemetry/collector-contrib-maintainer can.

Maybe you can accept the code review; the ready-for-merge label doesn't appear because I've pushed this?

@djaglowski djaglowski merged commit f8166e4 into open-telemetry:main Feb 1, 2024
95 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 1, 2024
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request 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 <[email protected]>
@alexvanboxel alexvanboxel deleted the pubsub-cloudlog branch May 4, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants