GreptimeTeam/demo-scene

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

shuiyisong opened this issue · 1 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.

We currently add demos covering /v1/influxdb/write and /v1/influxdb/api/v2/write.

In the following demos we'd covering Prometheus usages, we will cover /v1/prometheus/xxx.

SQL and PromQL query is included in every demo when we are analyzing the data. I suggest we can add some real-world scenarios to guide users how to write queries and how to migrate from other query slang like InfluxQL. We have a good start at https://docs.greptime.com/user-guide/migrate-to-greptimedb/migrate-from-influxdb#query-data. May or may not it should be part of our demos.

I don't have ideas about /v1/oltp/xxx yet.