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.19k stars 67 forks source link

Post to /telegraf api produce an error #461

Closed Friz-zy closed 7 months ago

Friz-zy commented 7 months ago

I'm testing latest qxip/qryn:bun with telegraf. I couldn't get authorization work properly for /influx/api/v2/write as there is no info how to convert user and password into token and telegraf doesn't work with user:password@url schema for some reason. So I thought I'd give it a try /telegraf api with this telegraf config:

[[outputs.http]]
  url = "http://172.18.0.6:3100/telegraf"
  data_format = "json"
  method = "POST"
  username = "test"
  password = "test"

After qryn starting produce this error:

qryn  | {"level":30,"time":1707745060205,"pid":1,"hostname":"486e423b0d92","name":"qryn","msg":"http://172.18.0.6:3100/telegraf"}
qryn  | 146 |   add: (values) => {
qryn  | 147 |     return new Promise((resolve, reject) => {
qryn  | 148 |       const id = getThrottlerId()
qryn  | 149 |       throttler.postMessage({
qryn  | 150 |         type: 'labels',
qryn  | 151 |         data: values.map(r => JSON.stringify({
qryn  |                     ^
qryn  | TypeError: undefined is not a function (near '...values.map...')
qryn  |       at /app/lib/db/clickhouse.js:151:15
qryn  |       at new Promise (:1:21)
qryn  |       at add (/app/lib/db/clickhouse.js:147:12)
qryn  |       at /app/lib/handlers/telegraf.js:46:9
qryn  |       at forEach (:1:21)
qryn  |       at handler (/app/lib/handlers/telegraf.js:34:5)
qryn  |       at /app/lib/bun_wrapper.js:101:18
qryn  | 146 |   add: (values) => {
qryn  | 147 |     return new Promise((resolve, reject) => {
qryn  | 148 |       const id = getThrottlerId()
qryn  | 149 |       throttler.postMessage({
qryn  | 150 |         type: 'labels',
qryn  | 151 |         data: values.map(r => JSON.stringify({
akvlad commented 7 months ago

The /telegraf endpoint moved to /influx endpoint and discussed in the https://github.com/metrico/qryn/issues/462 . We should consider removing it completely.

If there's no more complaints, let's close the issue.

Friz-zy commented 7 months ago

wiki should be updated then

lmangani commented 7 months ago

@Friz-zy the endpoint has been updated, although the instructions will need patching as well. Thanks!