i would like to test GreptimeDB Hosted with an OTe...
# general
n
i would like to test GreptimeDB Hosted with an OTel Collector. And use a new database for that (opentelemetry_lab for logs, traces and metrics), not the public. I create the db. Is there other steps to do ?
s
Don’t forget to add the header to specify the database with your OTel config. I believe that’s all 🫡 https://docs.greptime.com/greptimecloud/integrations/otlp/
n
I configured otel-collector like that:
Copy code
exporters:
  otlphttp/logs:
    endpoint: ${OTEL_EXPORTER_OTLP_LOGS_ENDPOINT}
    headers:
      x-greptime-db-name: "{env:GREPTIME_LOGS_DB_NAME}"
      # x-greptime-log-table-name: 'opentelemetry_logs'
      x-greptime-pipeline-name: "greptime_logs_v1"
      # x-greptime-pipeline-version: 'v1.0.0'
    tls:
      insecure: true
  otlphttp/metrics:
    endpoint: ${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT}
    headers:
      x-greptime-db-name: "{env:GREPTIME_METRICS_DB_NAME}"
    tls:
      insecure: true
  otlphttp/traces:
    endpoint: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT}
    headers:
      x-greptime-db-name: "{env:GREPTIME_TRACES_DB_NAME}"
      x-greptime-pipeline-name: 'greptime_trace_v1'
      # x-greptime-pipeline-version: 'v1.0.0'
    tls:
      insecure: true
and otel service like that:
Copy code
otel-collector:
    <<: *common
    image: otel/opentelemetry-collector-contrib:0.135.0
    container_name: otel
    command:
    - "--config=/conf/config.yaml"
    - "--feature-gates=service.profilesSupport"
    volumes:
    - ./etc/otel/otel-collector-greptimedb.yaml:/conf/config.yaml
    ports:
    - "4317:4317" # OTLP gRPC receiver
    - "4318:4318" # OTLP http receiver
    - "8889:8889" # Prometheus metrics exporter
    environment:
    - GREPTIME_LOGS_DB_NAME=opentelemetry_lab_logs
    - GREPTIME_METRICS_DB_NAME=opentelemetry_lab_metrics
    - GREPTIME_TRACES_DB_NAME=opentelemetry_lab_traces
    - OTEL_EXPORTER_OTLP_PROTOCOL=http
    - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=<http://frontend0:4000/v1/otlp>
    - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=<http://frontend0:4000/v1/otlp>
    - OTEL_EXPORTER_OTLP_PROFILES_ENDPOINT=<http://frontend0:4000/v1/otlp>
    - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=<http://frontend0:4000/v1/otlp>
it's ok .... i've got my metrics 🙂
🚀 2