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

New component: otlpjson connector #34208

Closed
3 tasks
ChrsMark opened this issue Jul 23, 2024 · 3 comments
Closed
3 tasks

New component: otlpjson connector #34208

ChrsMark opened this issue Jul 23, 2024 · 3 comments
Labels
Accepted Component New component has been sponsored

Comments

@ChrsMark
Copy link
Member

ChrsMark commented Jul 23, 2024

The purpose and use-cases of the new component

This new connector will be used in order to extract otlpjson from incoming Logs.
The connector will be responsible for unpacking valid otlp json from Log records
and specifically the Body field (this can be configurable).

This component will serve similarly to the otlpjsonfilereceiver but in a later stage
in the pipeline. This is particularly useful when the otlpjson cannot be consumed directly
by the aforementioned receiver.
An example use-case can be found at #33846.

Example configuration for the component

Initially the configuration can be quite basic like in otlpjsonfilereceiver but we can expand later according to the needs.

connectors:
  otlpjson:

The connector can be used in a pipeline to extract Logs, Metrics and Traces like this:

receivers:
  filelog:
    include:
      - /var/log/foo.log

exporters:
  debug:

connectors:
  otlpjson:

service:
  pipelines:
    logs/raw:
      receivers: [filelog]
      exporters: [otlpjson]
    metrics/otlp:
      receivers: [otlpjson]
      exporters: [debug]
    logs/otlp:
      receivers: [otlpjson]
      exporters: [debug]
    traces/otlp:
      receivers: [otlpjson]
      exporters: [debug]

Telemetry data types supported

  1. Logs to Logs
  2. Logs to Metrics
  3. Logs to Traces

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am a member of the OpenTelemetry organization.
  • If this is a vendor-specific component, I am proposing to contribute and support it as a representative of the vendor.

Code Owner(s)

@djaglowski, @ChrsMark

Sponsor (optional)

@djaglowski (#33846 (comment))

Additional context

  1. Filing this issue after we shortly chatted about it with @zeitlinger on Slack.
  2. A very basic PoC illustrating the idea can be found at https://github.com/ChrsMark/otlpjsonconnector.
@ChrsMark ChrsMark added needs triage New item requiring triage Sponsor Needed New component seeking sponsor labels Jul 23, 2024
@infor7
Copy link

infor7 commented Jul 23, 2024

I'd love the idea. I have similar use case. In my company we are saving metrics into files with openTSDB format in PVC in kubernetes. Metrics are automatically picked up by sidecar which transfer it to our observability platform. OTLP metric example:
put accessmanager.envoy.cluster.app-metrics-router-dev.zone.us-west1.us-west1-a.upstream_rq_time.P99 1721726558 93.2466666666666 direction=outbound port=4959 infra=mesh dc=us-west1-a namespace=accessmanager-dev pod_name=accessmanager-celery-flower-7f954746bf-qqmw8

I've tried to use stanza and build something like filelogreceiver but unfortunately that lib allows only to pick up the logs. If the otelcol lib will support metrics as well it should be pretty simple to write metric receiver with it.

@djaglowski djaglowski added Accepted Component New component has been sponsored and removed Sponsor Needed New component seeking sponsor needs triage New item requiring triage labels Jul 23, 2024
djaglowski pushed a commit that referenced this issue Jul 24, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This is the first PR for the new `otlpjson` connector. Includes the
overall structure of the new component.

**Link to tracking Issue:** <Issue number if applicable>
#34208

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>

/cc @djaglowski

Signed-off-by: ChrsMark <[email protected]>
djaglowski pushed a commit that referenced this issue Jul 25, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This is the 2nd PR for the new `otlpjson` connector
(#34208).
Adds the `ConsumeLogs` methods for the logs, metrics and traces
respective connector types.

At the moment, the connector retrieves the otlp json from the incoming
Log's `Body`. This is not configurable yet. It can be decided if that
needs to be.

In addition, there is no attribute/metadata extraction/transfer from the
incoming Log. This can be added in future iterations.

**Link to tracking Issue:** <Issue number if applicable>
#34208
#34239

**Testing:** <Describe what testing was performed and which tests were
added.> Added.

**Documentation:** <Describe the documentation added.> ~

Signed-off-by: ChrsMark <[email protected]>
djaglowski pushed a commit that referenced this issue Jul 26, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This is the 3rd PR for the new otlpjson connector
(#34208).
Moves its stability to `alpha`.

**Link to tracking Issue:** <Issue number if applicable>
#34208
#34239
#34249

**Testing:** <Describe what testing was performed and which tests were
added.> ~

**Documentation:** <Describe the documentation added.> Updated

---------

Signed-off-by: ChrsMark <[email protected]>
@ChrsMark
Copy link
Member Author

Tested that with https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.106.0.
@djaglowski I'm not 100% sure about the process here but I assume we can close this issue since the initial implementation of the component has been shipped.

@zeitlinger
Copy link
Member

thanks a lot for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Component New component has been sponsored
Projects
None yet
Development

No branches or pull requests

4 participants