Opentelemetry 数据持久性

huangapple go评论96阅读模式
英文:

Opentelemetry Data persistency

问题

我正在尝试将我的应用程序与OpenTelemetry集成。在当前解决方案中,OpenTelemetry收集器直接将数据导出到Jaeger。但我想在它们之间使用数据库,将数据发送到OpenTelemetry数据存储库,然后配置Jaeger从数据库中检索数据。主要目的是使用该数据库,将其配置到其他工具,如Zipkin等。我在此附上了我的当前docker-composer.yaml文件和otel-collector-config.yaml文件。有人可以帮助我吗?(如果是MongoDB或PostgreSQL Timescale数据库,那将很好。但任何解决方案都可以)

docker-compose.yaml文件:

version: '3.3'

services:
  # Jaeger
  jaeger-all-in-one:
    image: jaegertracing/all-in-one:latest
    ports:
      - "16686:16686"
      - "14268:14268"
      - "14250:14250"
  # Collector
  otel-collector:
    image: otel/opentelemetry-collector:latest
    command: ["--config=/etc/otel-collector-config.yaml"]
    volumes:
      - ./opentelemetry/otel-collector-config.yaml:/etc/otel-collector-config.yaml:Z
    ports:
      - "13133:13133" # Health_check extension
      - "4317:4317"   # OTLP gRPC receiver
      - "4318:4318"   # HTTP
    depends_on:
      - jaeger-all-in-one

networks:

volumes:

otel-collector-config.yaml文件:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: otel-collector:4317
      http:
        cors:
          allowed_origins:
            - "https://*"
            - "http://*"
          allowed_headers:
            - "*"

exporters:
  jaeger:
    endpoint: jaeger-all-in-one:14250
    tls:
      insecure: true

processors:
  batch:

extensions:
  health_check:

service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger]
英文:

I am try to integrate my application with OpenTelemetry. In the current solution openTelemetry collector export data directly to the jaeger. But I want to use Database between them and want to send data to OpenTelemetry data to that database and then configure jaeger to retriever that data from database. Main purpose is using that data base it should be configure to any another tool like zipkin or etc... I include my current docker-composer.yaml file and otel-collector-config.yaml file with this. Can someone help me with this. (if it is mongodb or postgress timescale db it will be nice. But any solutions are ok)

docker-compose.yaml file

version: '3.3'

services:
  # Jaeger
  jaeger-all-in-one:
    image: jaegertracing/all-in-one:latest
    ports:
      - "16686:16686"
      - "14268:14268"
      - "14250:14250"
  # Collector
  otel-collector:
    image: otel/opentelemetry-collector:latest
    command: ["--config=/etc/otel-collector-config.yaml"]
    volumes:
      - ./opentelemetry/otel-collector-config.yaml:/etc/otel-collector-config.yaml:Z
    ports:
      - "13133:13133" # Health_check extension
      - "4317:4317"   # OTLP gRPC receiver
      - "4318:4318" # HTTP
    depends_on:
      - jaeger-all-in-one  
networks:

volumes:

otel-collector-config.yaml

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: otel-collector:4317
      http:
        cors:
          allowed_origins:
            - "https://*"
            - "http://*"
          allowed_headers:
            - "*"

exporters:
  jaeger:
    endpoint: jaeger-all-in-one:14250
    tls:
      insecure: true

processors:
  batch:

extensions:
  health_check:

service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger]

答案1

得分: 2

我认为你所期望的解决方案过于复杂。OTEL原生解决方案是直接将跟踪发送到多个跟踪后端(你提到的“数据库”术语)。示例配置片段:

...
exporters:
  jaeger:
    <jaeger-configs>
  zipkin:
    <zipkin-configs>
  <another-exporter>:
    <another-exporter-configs>
...
service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger, zipkin, <another-exporter>]

你可以使用多种类型的导出器 - https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter(顺便说一句,不支持你期望的数据库“mongodb或postgress timescale db”)

英文:

I would say your desired solution is overengineered. OTEL native solution is to send traces to multiple trace backends (your "database" term) directly. Example config snippet:

...
exporters:
  jaeger:
    &lt;jaeger-configs&gt;
  zipkin:
    &lt;zipkin-configs&gt;
  &lt;another-exporter&gt;:
    &lt;another-exporter-configs&gt;
...
service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger, zipkin, &lt;another-exporter&gt;]

You have available many types of exporter - https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter (BTW no your desired DB mongodb or postgress timescale db is supported)

huangapple
  • 本文由 发表于 2023年2月24日 14:57:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553425.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定