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

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

Open
shuiyisong opened this issue Mar 19, 2024 · 1 comment

Comments

@shuiyisong
Copy link
Contributor

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.

@waynexia waynexia changed the title Adding minial demos for various client api to write data into Greptime database Adding minimal demos for various client api to write data into Greptime database Mar 19, 2024
@tisonkun
Copy link
Contributor

tisonkun commented May 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants