GithubHelp home page GithubHelp logo

greptimeteam / demo-scene Goto Github PK

View Code? Open in Web Editor NEW
22.0 6.0 6.0 3.48 MB

👾Scripts and samples to support Greptime Demos and Talks. ⚠️Might be rough around the edges ;-)

Home Page: https://greptime.com

License: Apache License 2.0

Python 100.00%
cloud demo greptimedb mysql time-series

demo-scene's Issues

Implement itertools.batched with a function to drop requirement of Python 3.12+ in InfluxDB demo

# TODO implement itertools.batched with a functionn to drop requirement of Python 3.12+
for batch_lines in itertools.batched(lines, 1000):
write_api.write(bucket=bucket, write_precision=args.precision, record=batch_lines)
print(f'Wrote {len(batch_lines)} lines')
sleep(1) # sleep for 1 second avoid rate limit

Ref Python Doc - https://docs.python.org/3/library/itertools.html#itertools.batched

Error- write request banned

I keep running into the following error:

ERROR <module> Unhandled exception for futures: (MySQLdb.OperationalError) (1815, 'Write request banned for [Database] until [time UTC]

I'm using a Windows 10 22H2 and use Windows Powershell to run
python agent.py
as the command.

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

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.

Missing dotenv in keyboard-monitor requirements.txt

Traceback (most recent call last):
  File "/Users/dennis/programming/python/demo-scene/keyboard-monitor/agent.py", line 1, in <module>
    from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.