edgexfoundry / app-service-configurable

Owner: Applications WG
Apache License 2.0
18 stars 47 forks source link

App-metrics-influxdb reports "204 No Content Response" for metrics data exported to InfluxDB #671

Closed M0hanrajp closed 2 months ago

M0hanrajp commented 2 months ago

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in metrics-influxdb

The metrics data reported by core-data & device-virtual are recorded in app-metric-influxdb service & sent via HTTP export but in response get 204 No Content Response.

Is this a regression?

Not sure on regression testing, I have only executed this on 3.1 Napa docker images.

Description and Minimal Reproduction [REQUIRED]

image

πŸ”₯ Exception or Error

Why app-metrics-influxdb reports 204 No Content ? is this expected for metric data ?

edgex-app-metrics-influxdb logs:

edgex-app-metrics-influxdb  | level=DEBUG app=app-metrics-influxdb source=http.go:127 msg="HTTP Exporting in pipeline 'default-pipeline'"
edgex-app-metrics-influxdb  | level=DEBUG app=app-metrics-influxdb source=http.go:192 msg="Setting HTTP Header 'authorization' with secret value from SecretStore at secretName='influxdb' & secretKeyValue='token in pipeline 'default-pipeline'"
edgex-app-metrics-influxdb  | level=DEBUG app=app-metrics-influxdb source=http.go:209 msg="POSTing data to http://edgex-influxdb:8086/api/v2/write?org=metrics&bucket=edgex&precision=ns in pipeline 'default-pipeline'"
# "Sent 569 bytes of data in pipeline 'default-pipeline'. Response status is 204 No Content"
edgex-app-metrics-influxdb  | level=DEBUG app=app-metrics-influxdb source=http.go:241 msg="Sent 569 bytes of data in pipeline 'default-pipeline'. Response status is 204 No Content"
edgex-app-metrics-influxdb  | level=TRACE app=app-metrics-influxdb source=http.go:242 msg="Data exported for pipeline 'default-pipeline' (X-Correlation-ID=11b61087-24a8-458c-912b-3f25efc3aeb8)"

🌍 Your Environment

Deployment Environment: Ubuntu 22.04.4 LTS

EdgeX Version: 3.1 Napa


Thanks

cloudxxx8 commented 2 months ago

What is wrong when you get the response of 204 No Content? It's Influx's API design to indicate the REST is successful, and there is no need to provide response body.

M0hanrajp commented 2 months ago

What is wrong when you get the response of 204 No Content? It's Influx's API design to indicate the REST is successful, and there is no need to provide response body.

app-metrics-influxdb was able to send data to influx db instance, shouldn't the response be 200 instead of 204 ?, or because the transaction was successful and there is no need to provide response body is it the reason by design 204 code is sent ?

cloudxxx8 commented 2 months ago

It's the API design from InfluxDB, not our service. However, I think 204 is the right design, and that's the status code for. What do you expect from the 200 response body? If there is no error, the response body is unnecessary.

M0hanrajp commented 2 months ago

It's the API design from InfluxDB, not our service. However, I think 204 is the right design, and that's the status code for. What do you expect from the 200 response body? If there is no error, the response body is unnecessary.

OK understood, I think there is no response body required for each metric being sent to influxdb.