Hi everyone. I`m facing a very challenging issue while using with `httplogreceiver/json` collector w...
i
Hi everyone. I`m facing a very challenging issue while using with
httplogreceiver/json
collector with docker standalone version
v0.44.0
. Some attributes are randomly not being consumed from a json body request and therefore not shown in the logs display: http request:
Copy code
{
	"date": "2024-05-01T14:08:18.200Z",
	"host": "myhost",
	"attributes": {
		"level": "INFO",
		"logger": {
			"my_name": "my_name value",
			"name": "my logger"
		},
		"timestamp": 1714572498200
	},
	"_id": "AY80fB7-AADBCfRSe5c2mQAZ",
	"message": "my message",
	"status": "info",
	"tags": ["service:my service","source:my source","sourcecategory:my category","filename:my.file","auth:api_key"],
	"timestamp": 1714572498200,
	"resources": {
		"host": "my host"
	},
}
also I`ve tried the request:
Copy code
{
  "date": "2024-05-01T14:08:18.200Z",
  "service": "my service",
  "host": "myhost",
  "attributes": {
    "level": "INFO",
    "logger": {
      "my_name": "my_name value",
      "name": "my logger"
    },
    "timestamp": 1714572498200
  },
  "_id": "AY80fB7-AADBCfRSe5c2mQAZ",
  "source": "my source",
  "message": "my message",
  "status": "info",
  "tags": [
    "service:my service",
    "source:my source",
    "sourcecategory:my category",
    "filename:my.file",
    "auth:api_key"
  ],
  "timestamp": 1714572498200,
  "resources": {
    "host": "my host"
  },
  "sourcecategory": "sourcecode",
  "filename": "my.file",
  "auth": "api_key"
}
both cases I get any of service, source, sourcecategory, filename, auth randomly set in the logs. Would anyone know why or has ever experienced anything similar? Thanks.
n
In the first example only tags will be your attribute it won’t parse the nested data and will be stored as a string. In the second payload the source, sourcecategory should be present in the attributes.
i
Hi @nitya-signoz thanks for the reply. Interestingly, the first case the tags are auto parsed into attributes which is pretty cool!
the problem is that is random
in the second, I manually changed the request by parsing tags into attributes before sending to httplogreceiver/json and also got the same results
n
can you send the curl request for that ?
i
It`s random but there it goes the curl command you requested
Copy code
curl --location '<https://myserver.service.com>' --header 'Content-Type: application/json' --data @sample-copy.request
sample-copy.request
the case above I`ve run the command twice
@nitya-signoz ^^^
n
Sorry missed it, let me check
I am not able to replicate the issue, can you try running the otel collector locally and use the logging exporter to see if you are able to log them. This is a config that you can use to run the collector
Copy code
receivers:
  httplogreceiver/json:
    endpoint: 0.0.0.0:8082
    source: json
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:
    send_batch_size: 10000
    send_batch_max_size: 11000
    timeout: 10s
extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  zpages:
    endpoint: 0.0.0.0:55679
  pprof:
    endpoint: 0.0.0.0:1777

exporters:
  logging:
    verbosity: detailed

service:
  telemetry:
    metrics:
      address: 0.0.0.0:8888
  extensions:
    - health_check
    - zpages
    - pprof
  pipelines:
    logs:
      receivers: [otlp, httplogreceiver/json]
      processors: []
      exporters: [logging]
now trey sending the request to localhost:8082