metrico / qryn

⭐️ All-in-One Polyglot Observability with OLAP Storage for Logs, Metrics, Traces & Profiles. Drop-in Grafana Cloud replacement compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog and beyond :rocket:
https://qryn.dev
GNU Affero General Public License v3.0
1.24k stars 68 forks source link

Undefined Parser #441

Closed gauravpareekk closed 9 months ago

gauravpareekk commented 9 months ago

Hi!

I'm doing a basic deployment of qryn where qryn is connecting to self hosted clickhouse. However, after starting qryn through the latest docker image. This is the error being seen as soon as it starts. not sure the issue here but no data is being pushed.

I'm using grafana faro + qryn + clickhouse

qryn_1 | {"level":50,"time":1706288370434,"pid":22,"hostname":"3f19fe760690","name":"qryn","reqId":"req-3","err":"undefined parser\nError: undefined parser\n at Parser.fn (/app/parsers.js:263:15)\n at ContentTypeParser.run (/app/node_modules/fastify/lib/contentTypeParser.js:177:27)\n at handleRequest (/app/node_modules/fastify/lib/handleRequest.js:41:33)\n at next (/app/node_modules/fastify/lib/hooks.js:339:7)\n at Object.<anonymous> (/app/qryn_node.js:110:7)\n at next (/app/node_modules/fastify/lib/hooks.js:345:30)\n at preParsingHookRunner (/app/node_modules/fastify/lib/hooks.js:368:3)\n at runPreParsing (/app/node_modules/fastify/lib/route.js:587:5)\n at next (/app/node_modules/fastify/lib/hooks.js:237:9)\n at /app/node_modules/@fastify/cors/index.js:201:12","msg":"undefined parser"}

vaisov commented 9 months ago

+1 having same issue

my grafana-agent.yml as per https://blog.qryn.dev/grafana-faro-qryn

server:
  http_tls_config:
    cert_file: /etc/grafana/grafana.crt
    key_file: /etc/grafana/grafana.key

metrics:
  wal_directory: /tmp/wal
  global: {}
  configs:
    - name: default
      remote_write:
        - url: http://localhost:3100/api/prom/push
          basic_auth:
            username: qryn
            password: xxx
logs:
  positions_directory: /tmp/loki-pos
  configs:
    - name: default
      scrape_configs: []
      clients:
        - url: http://qryn:xxx@localhost:3100/loki/api/v1/push
traces:
  configs:
    - name: default
      remote_write:
        - endpoint: localhost:3100
          insecure: true
          basic_auth:
            username: qryn
            password: xxx
      receivers:
        otlp:
          protocols:
            grpc:
            http:
              cors:
                allowed_origins:
                  - http://*
                max_age: 7200

integrations:
  app_agent_receiver_configs:
    - autoscrape:
        enable: true
        metrics_instance: 'default'
      # api_key: 'secret' # optional, if set, client will be required to provide it via x-api-key header
      instance: 'frontend'
      logs_instance: 'default'
      traces_instance: 'default'
      server:
        host: 0.0.0.0
        port: 12345
        cors_allowed_origins:
          - http://*
          #        cors_allowed_origins:
          #          - 'https://my-app.example.com'
      logs_labels: # labels to add to loki log record
        app: frontend # static value
        kind: # value will be taken from log items. exception, log, measurement, etc
      logs_send_timeout: 5000
      sourcemaps:
        download: true

qryn is running in docker compose:

version: '3.8'

services:
  qryn:
    image: qxip/qryn:3.1.2
    ports:
      - "3100:3100"
    environment:
      - CLICKHOUSE_SERVER=clickhouse-server
      - CLICKHOUSE_AUTH=qryn:supersecretpassword
      - CLICKHOUSE_DB=qryn
  clickhouse-server:
    image: clickhouse/clickhouse-server:latest
    container_name: clickhouse-server
    environment:
      - CLICKHOUSE_USER=qryn
      - CLICKHOUSE_PASSWORD=xxx
    ports:
      - 8123:8123
    healthcheck:
      test: ['CMD', 'wget', '--spider', '-q', '127.0.0.1:8123/ping']
      interval: 1s
      timeout: 1s
      retries: 30
vaisov commented 9 months ago

Looks like the issue is solved by replacing api/prom/push to api/v1/prom/remote/write. I'll check if now other parts are working

akvlad commented 9 months ago

Hello. Short reminder of the paths open for remote write:

    '/api/v1/prom/remote/write',
    '/api/prom/remote/write',
    '/prom/remote/write',
    '/api/v1/write'

The other paths for the remote write will probably respond as "undefined parser error".

akvlad commented 9 months ago

On the other hand the proper response should be 404 Not Found. Maybe that's a bug to fix.

lmangani commented 9 months ago

We can easily also add /api/prom/push to the aliases for the API if its commonly used DRAFT PR

vaisov commented 9 months ago

So either /api/prom/push should be added as an alias or this blog post example config fixed https://blog.qryn.dev/grafana-faro-qryn

lmangani commented 9 months ago

@vaisov the PR is already open and will be merged today

lmangani commented 9 months ago

@gauravpareekk @vaisov please retest with qryn@3.1.5

lmangani commented 9 months ago

Request implemented with #442 Feel free to reopen in case of issues.