GreptimeTeam/demo-scene

Adding minimal demos for various client api to write data into Greptime database

shuiyisong opened this issue · 0 comments

We now have various protocol supported in HTTP api, Here are some entry paths for read and/or write:

/v1/sql 
/v1/promql 

/v1/influxdb/write 
/v1/influxdb/api/v2/write 

/v1/prometheus/read 
/v1/prometheus/write 

/v1/prometheus/api/v1/query 
/v1/prometheus/api/v1/query_range 
/v1/prometheus/api/v1/labels 
/v1/prometheus/api/v1/series 
/v1/prometheus/api/v1/label/:label_name/values 

/v1/oltp/v1/metrics 
/v1/oltp/v1/traces

For simple protocols like influxdb, a curl command would be enough to actually for users to follow up and write data into out database; However for protocols like OTLP, a step by step example of modifying docker config using Greptime endpoint, running OTLP official docker image and be able to write data into the database would be much more straight forward than just showing how to config Greptime endpoint.

For example, save the following code as config.yaml

# config.yaml
receivers:
  hostmetrics:
    scrapers:
      cpu:
      disk:
      filesystem:
      load:
      memory:
      network:
      process:
      processes:
      paging:

exporters:
  otlphttp:
    endpoint: http://localhost:4000/v1/otlp
    compression: none
    tls:
      insecure: true

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    metrics:
      receivers: [hostmetrics]
      exporters: [otlphttp]

And run docker run --rm --network host -v ./config.yaml:/etc/otelcol/config.yaml otel/opentelemetry-collector will start an exporter and write metrics data using Greptime's HTTP OTLP metrics api.