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

Post to /telegraf api produce an error #461

Closed
Friz-zy opened this issue Feb 12, 2024 · 3 comments
Closed

Post to /telegraf api produce an error #461

Friz-zy opened this issue Feb 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Friz-zy
Copy link

Friz-zy commented Feb 12, 2024

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({
@lmangani lmangani added the bug Something isn't working label Feb 14, 2024
@akvlad
Copy link
Collaborator

akvlad commented Feb 19, 2024

The /telegraf endpoint moved to /influx endpoint and discussed in the #462 .
We should consider removing it completely.

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

@Friz-zy
Copy link
Author

Friz-zy commented Feb 19, 2024

wiki should be updated then

@Friz-zy Friz-zy closed this as completed Feb 19, 2024
@lmangani
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants