Slackbot
08/16/2023, 11:27 AMnitya-signoz
08/16/2023, 11:30 AMTarek Esmail
08/16/2023, 11:47 AMtenantId
how i can use this one as label
Can you help me on that ?nitya-signoz
08/16/2023, 11:47 AMTarek Esmail
08/16/2023, 11:48 AMTarek Esmail
08/16/2023, 11:49 AMlogstransform/internal:
operators:
- if: '"trace_id" in attributes or "span_id" in attributes'
output: remove_trace_id
span_id:
parse_from: attributes.span_id
trace_id:
parse_from: attributes.trace_id
type: trace_parser
- if: '"traceId" in attributes or "spanId" in attributes'
output: remove_traceId
span_id:
parse_from: attributes.spanId
trace_id:
parse_from: attributes.traceId
type: trace_parser
- field: attributes.traceId
id: remove_traceId
if: '"traceId" in attributes'
output: remove_spanId
type: remove
- field: attributes.spanId
id: remove_spanId
if: '"spanId" in attributes'
type: remove
- field: attributes.trace_id
id: remove_trace_id
if: '"trace_id" in attributes'
output: remove_span_id
type: remove
- field: attributes.span_id
id: remove_span_id
if: '"span_id" in attributes'
type: remove
Tarek Esmail
08/16/2023, 11:49 AMnitya-signoz
08/16/2023, 11:50 AMTarek Esmail
08/16/2023, 11:51 AMTarek Esmail
08/16/2023, 11:52 AMTarek Esmail
08/16/2023, 11:52 AMTarek Esmail
08/16/2023, 11:54 AMnitya-signoz
08/16/2023, 12:02 PMotelCollector:
config:
processors:
logstransform/parse_tid:
operators:
- default: noop
id: router_signoz
type: router
routes:
- expr: 'body matches ".*\\\"tenantId\\\":\\\"(?P<tenantId>\\w+)\\\""'
output: extract_tenantId
- id: extract_tenantId
type: regex_parser
regex: '.*\"tenantId\":\"(?P<tenantId>\w+)\"'
parse_from: body
output: noop
- id: noop
type: noop
service:
pipelines:
logs:
receivers: [otlp]
processors: [logstransform/parse_tid, logstransform/internal, batch]
exporters: [clickhouselogsexporter]
Tarek Esmail
08/16/2023, 12:03 PMTarek Esmail
08/16/2023, 12:05 PMTarek Esmail
08/16/2023, 12:07 PMTarek Esmail
08/16/2023, 12:10 PMTarek Esmail
08/16/2023, 12:10 PMTarek Esmail
08/16/2023, 12:11 PMTarek Esmail
08/16/2023, 12:11 PMShivanshu Raj Shrivastava
08/16/2023, 12:14 PMTarek Esmail
08/16/2023, 12:14 PMTarek Esmail
08/16/2023, 12:15 PM{
"timestamp": 1692187765868840000,
"id": "2U48JQCA8Ob7k3tYQZZouyDNA6A",
"trace_id": "",
"span_id": "",
"trace_flags": 0,
"severity_text": "",
"severity_number": 0,
"body": "{\"name\":\"xxx\",\"hostname\":\"xxx-xxx-644d656d99-c24x5\",\"pid\":17,\"component\":\"nodeWorkerSQS\",\"level\":\"INFO\",\"messageType\":\"integration_process\",\"body\":{\"type\":\"integration_process\",\"integrationType\":\"twitter\",\"tenantId\":\"xxxx\",\"onboarding\":false,\"integrationId\":\"xxxx\",\"retryStreams\":[{\"id\":\"xxxxx\",\"retryCount\":1,\"stream\":{\"value\":\"mentions\",\"metadata\":{\"page\":\"\"}}}],\"remainingStreams\":[{\"value\":\"followers\",\"metadata\":{\"page\":\"\"}}]},\"msg\":\"Sending xxx sqs message!\",\"time\":\"2023-08-16T12:09:25.868Z\",\"v\":0}",
"resources_string": {
"k8s_cluster_name": "xxxx",
"k8s_container_name": "xxx",
"k8s_container_restart_count": "0",
"k8s_deployment_name": "xxx-xxx",
"k8s_namespace_name": "default",
"k8s_node_name": "xxxxx",
"k8s_pod_name": "xxxx",
"k8s_pod_start_time": "2023-08-14 10:08:54 +0000 UTC",
"k8s_pod_uid": "b1e86f6d-42b6-46f9-903c-d5269a6b44a9"
},
"attributes_string": {
"log_file_path": "/var/log/pods/default_xxx-xxx-644d656d99-c24x5_b1e86f6d-42b6-46f9-903c-d5269a6b44a9/xxx/0.log",
"log_iostream": "stdout",
"logtag": "F",
"time": "2023-08-16T12:09:25.868839814Z"
},
"attributes_int": {},
"attributes_float": {}
}
Tarek Esmail
08/16/2023, 12:16 PMShivanshu Raj Shrivastava
08/16/2023, 12:17 PM{
"name": "xxx",
"hostname": "xxx-xxx-644d656d99-c24x5",
"pid": 17,
"component": "nodeWorkerSQS",
"level": "INFO",
"messageType": "integration_process",
"body": {
"type": "integration_process",
"integrationType": "twitter",
"tenantId": "xxxx",
"onboarding": false,
"integrationId": "xxxx",
"retryStreams": [
{
"id": "xxxxx",
"retryCount": 1,
"stream": {
"value": "mentions",
"metadata": {
"page": ""
}
}
}
],
"remainingStreams": [
{
"value": "followers",
"metadata": {
"page": ""
}
}
]
},
"msg": "Sending xxx sqs message!",
"time": "2023-08-16T12:09:25.868Z",
"v": 0
}
Tarek Esmail
08/16/2023, 12:18 PMShivanshu Raj Shrivastava
08/16/2023, 12:18 PMTarek Esmail
08/16/2023, 12:21 PMShivanshu Raj Shrivastava
08/16/2023, 12:30 PMotelCollector:
config:
processors:
logstransform/parse_tid:
operators:
- type: json_parser
id: parser-docker
output: extract_metadata_from_filepath
timestamp:
parse_from: body.time
layout: '%%Y-%%m-%%dT%%H:%%M:%%S.%%LZ'
service:
pipelines:
logs:
receivers: [otlp]
processors: [logstransform/parse_tid, logstransform/internal, batch]
exporters: [clickhouselogsexporter]
With this, you should see be able to see an attribute body.body.tenantId
with value as your tanantIdShivanshu Raj Shrivastava
08/16/2023, 12:30 PMotelCollector:
config:
processors:
logstransform/parse_tid:
operators:
- type: json_parser
id: parser-docker
output: extract_metadata_from_filepath
timestamp:
parse_from: body.time
layout: '%%Y-%%m-%%dT%%H:%%M:%%S.%%LZ'
- type: move
from: body.body.tenantId
to: attributes["k8s.tenantId"]
service:
pipelines:
logs:
receivers: [otlp]
processors: [logstransform/parse_tid, logstransform/internal, batch]
exporters: [clickhouselogsexporter]
Tarek Esmail
08/16/2023, 8:47 PM2023/08/16 12:37:40 application run finished with error: failed to build pipelines: failed to create "logstransform/parse_tid" processor, in pipeline "logs": operator 'extract_metadata_from_filepath' does not exist: {"operator_id":"parser-docker"}
nitya-signoz
08/17/2023, 3:35 AMotelCollector:
config:
processors:
logstransform/parse_tid:
operators:
- default: noop
id: router_signoz
routes:
- expr: 'body matches "^{.*}$"'
output: parse_json
type: router
# json parser
- id: parse_json
type: json_parser
parse_from: body
parse_to: attributes.temp
output: move_tenantId
- type: move
id: move_tenantId
from: attributes.temp.body.tenantId
to: attributes.tenantId
if: '"body" in attributes.temp and "tenantId" in attributes.temp.body'
output: remove_temp
- type: remove
id: remove_temp
field: attributes.temp
output: noop
- id: noop
type: noop
service:
pipelines:
logs:
receivers: [otlp]
processors: [logstransform/parse_tid, logstransform/internal, batch]
exporters: [clickhouselogsexporter]
Tarek Esmail
08/17/2023, 6:52 AMnitya-signoz
08/17/2023, 7:03 AM- type: move
id: move_tenantId
from: attributes.temp.body.tenantId
to: attributes.tenantId
if: '"body" in attributes.temp and "tenantId" in attributes.temp.body'
output: remove_temp
SigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.
Powered by