Skip to content

Commit

Permalink
doc: add document for HTTP Header (#5070)
Browse files Browse the repository at this point in the history
* doc: add document for HTTP Header

* doc: mv links to bottom
  • Loading branch information
qingbozhang authored Apr 7, 2022
1 parent e8d131d commit 620c88c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions config/confighttp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ will not be enabled.
- `endpoint`: Valid value syntax available [here](https://github.com/grpc/grpc/blob/master/doc/naming.md)
- [`tls`](../configtls/README.md)

[cors]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
[cors-headers]: https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header
[cors-cache]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin
You can enable [`attribute processor`][attribute-processor] to append any http header to span's attribute using custom key. You also need to enable the "include_metadata"

Example:

Expand All @@ -79,6 +76,7 @@ receivers:
otlp:
protocols:
http:
include_metadata: true
cors:
allowed_origins:
- https://foo.bar.com
Expand All @@ -87,4 +85,16 @@ receivers:
- Example-Header
max_age: 7200
endpoint: 0.0.0.0:55690
processors:
attributes:
actions:
- key: http.client_ip
from_context: X-Forwarded-For
action: upsert
```

[cors]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
[cors-headers]: https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header
[cors-cache]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin
[attribute-processor]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor/README.md

0 comments on commit 620c88c

Please sign in to comment.