Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/feat_add-more-fields-to-nlb-extension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: extension/encoding

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add more fields to AWS NLB logs at ELB extension

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [43757]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
48 changes: 24 additions & 24 deletions extension/encoding/awslogsencodingextension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,30 +403,30 @@ ELB access log record fields are mapped this way in the resulting OpenTelemetry

> AWS Fields are according to [documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest//network/load-balancer-access-logs.html#access-log-entry-format).

| **AWS Field** | **OpenTelemetry Field(s)** |
|------------------------------|-------------------------------------------------------------|
| type | `network.protocol.name` |
| version | `network.protocol.version` |
| time | Log timestamp |
| elb | `cloud.resource_id` |
| listener | `aws.elb.tls.listener.resource_id` |
| client:port | `client.address`, `client.port` |
| destination:port | `destination.address`, `destination.port` |
| received_bytes | `http.request.size` |
| sent_bytes | `http.response.size` |
| tls_cipher | `tls.cipher` |
| tls_protocol_version | `tls.protocol.version` |
| domain_name | `url.domain` |
| connection_time | _Currently not supported_ |
| tls_handshake_time | _Currently not supported_ |
| incoming_tls_alert | _Currently not supported_ |
| chosen_cert_arn | _Currently not supported_ |
| chosen_cert_serial | _Currently not supported_ |
| tls_named_group | _Currently not supported_ |
| alpn_fe_protocol | _Currently not supported_ |
| alpn_be_protocol | _Currently not supported_ |
| alpn_client_preference_list | _Currently not supported_ |
| tls_connection_creation_time | _Currently not supported_ |
| **AWS Field** | **OpenTelemetry Field(s)** |
|------------------------------|-------------------------------------------|
| type | `network.protocol.name` |
| version | `network.protocol.version` |
| time | Log timestamp |
| elb | `cloud.resource_id` |
| listener | `aws.elb.tls.listener.resource_id` |
| client:port | `client.address`, `client.port` |
| destination:port | `destination.address`, `destination.port` |
| received_bytes | `http.request.size` |
| sent_bytes | `http.response.size` |
| tls_cipher | `tls.cipher` |
| tls_protocol_version | `tls.protocol.version` |
| domain_name | `url.domain` |
| connection_time | `aws.elb.connection_time` |
| tls_handshake_time | `aws.elb.tls_handshake_time` |
| incoming_tls_alert | `aws.elb.incoming_tls_alert` |
| chosen_cert_arn | `aws.elb.chosen_cert_arn` |
| chosen_cert_serial | `aws.elb.chosen_cert_serial` |
| tls_named_group | `aws.elb.tls_named_group` |
| alpn_fe_protocol | `aws.elb.alpn_fe_protocol` |
| alpn_be_protocol | `aws.elb.alpn_be_protocol` |
| alpn_client_preference_list | `aws.elb.alpn_client_preference_list` |
| tls_connection_creation_time | `aws.elb.tls_connection_creation_time` |

#### Classic Load Balancer (CLB)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@
package elbaccesslogs // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/awslogsencodingextension/internal/unmarshaler/elb-access-log"

const (
AttributeELBStatusCode = "aws.elb.status.code" // int
AttributeELBBackendStatusCode = "aws.elb.backend.status.code" // int
AttributeTLSListenerResourceID = "aws.elb.tls.listener.resource_id" // string
AttributeELBRequestProcessingTime = "aws.elb.request_processing_time" // float
AttributeELBResponseProcessingTime = "aws.elb.response_processing_time" // float
AttributeELBTargetProcessingTime = "aws.elb.target_processing_time" // float
AttributeELBTargetGroupARN = "aws.elb.target_group_arn" // string
AttributeELBChosenCertARN = "aws.elb.chosen_cert_arn" // string
AttributeELBActionsExecuted = "aws.elb.actions_executed" // string
AttributeELBRedirectURL = "aws.elb.redirect_url" // string
AttributeELBErrorReason = "aws.elb.error_reason" // string
AttributeELBClassification = "aws.elb.classification" // string
AttributeELBClassificationReason = "aws.elb.classification_reason" // string
AttributeELBConnectionTraceID = "aws.elb.connection_trace_id" // string
AttributeELBTransformedHost = "aws.elb.transformed_host" // string
AttributeELBTransformedURI = "aws.elb.transformed_uri" // string
AttributeELBRequestTransformStatus = "aws.elb.request_transform_status" // string
AttributeELBAWSTraceID = "aws.elb.aws_trace_id" // string
AttributeELBStatusCode = "aws.elb.status.code" // int
AttributeELBBackendStatusCode = "aws.elb.backend.status.code" // int
AttributeTLSListenerResourceID = "aws.elb.tls.listener.resource_id" // string
AttributeELBRequestProcessingTime = "aws.elb.request_processing_time" // float
AttributeELBResponseProcessingTime = "aws.elb.response_processing_time" // float
AttributeELBTargetProcessingTime = "aws.elb.target_processing_time" // float
AttributeELBTargetGroupARN = "aws.elb.target_group_arn" // string
AttributeELBChosenCertARN = "aws.elb.chosen_cert_arn" // string
AttributeELBActionsExecuted = "aws.elb.actions_executed" // string
AttributeELBRedirectURL = "aws.elb.redirect_url" // string
AttributeELBErrorReason = "aws.elb.error_reason" // string
AttributeELBClassification = "aws.elb.classification" // string
AttributeELBClassificationReason = "aws.elb.classification_reason" // string
AttributeELBConnectionTraceID = "aws.elb.connection_trace_id" // string
AttributeELBTransformedHost = "aws.elb.transformed_host" // string
AttributeELBTransformedURI = "aws.elb.transformed_uri" // string
AttributeELBRequestTransformStatus = "aws.elb.request_transform_status" // string
AttributeELBAWSTraceID = "aws.elb.aws_trace_id" // string
AttributeELBConnectionTime = "aws.elb.connection_time" // int64
AttributeELBTLSNamedGroup = "aws.elb.tls_named_group" // string
AttributeELBTLSHandshakeTime = "aws.elb.tls_handshake_time" // int64
AttributeELBTLSConnectionCreationTime = "aws.elb.tls_connection_creation_time" // int64
AttributeELBIncomingTLSAlert = "aws.elb.incoming_tls_alert" // string
AttributeELBChosenCertSerial = "aws.elb.chosen_cert_serial" // string
AttributeALPNFeProtocol = "aws.elb.alpn_fe_protocol" // string
AttributeALPNBeProtocol = "aws.elb.alpn_be_protocol" // string
AttributeALPNClientPreferenceList = "aws.elb.alpn_client_preference_list" // string
)
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tls 2.0 2018-12-20T02:59:40 net/my-network-loadbalancer/c6e77e28c25b2234 g3d4b5e8bb8464cd 72.21.218.154:51341 172.100.100.185:443 5 2 98 246 - arn:aws:acm:us-east-2:671290407336:certificate/2a108f19-aded-46b0-8493-c63eb1ef4a99 - ECDHE-RSA-AES128-SHA tlsv12 - my-network-loadbalancer-c6e77e28c25b2234.elb.us-east-2.amazonaws.com - - - 2018-12-20T02:59:30
tls 2.0 2020-04-01T08:51:42 net/my-network-loadbalancer/c6e77e28c25b2234 g3d4b5e8bb8464cd 72.21.218.154:51341 172.100.100.185:443 5 2 98 246 - arn:aws:acm:us-east-2:671290407336:certificate/2a108f19-aded-46b0-8493-c63eb1ef4a99 - ECDHE-RSA-AES128-SHA tlsv12 - my-network-loadbalancer-c6e77e28c25b2234.elb.us-east-2.amazonaws.com h2 h2 "h2","http/1.1" 2020-04-01T08:51:20
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,105 @@ resourceLogs:
- key: tls.cipher
value:
stringValue: ECDHE-RSA-AES128-SHA
- key: aws.elb.connection_time
value:
intValue: "5"
- key: aws.elb.tls_handshake_time
value:
intValue: "2"
- key: aws.elb.incoming_tls_alert
value:
stringValue: '-'
- key: aws.elb.tls_named_group
value:
stringValue: '-'
- key: aws.elb.chosen_cert_arn
value:
stringValue: arn:aws:acm:us-east-2:671290407336:certificate/2a108f19-aded-46b0-8493-c63eb1ef4a99
- key: aws.elb.chosen_cert_serial
value:
stringValue: '-'
- key: aws.elb.alpn_fe_protocol
value:
stringValue: '-'
- key: aws.elb.alpn_be_protocol
value:
stringValue: '-'
- key: aws.elb.alpn_client_preference_list
value:
stringValue: '-'
- key: aws.elb.tls_connection_creation_time
value:
stringValue: 2018-12-20T02:59:30
- key: url.domain
value:
stringValue: my-network-loadbalancer-c6e77e28c25b2234.elb.us-east-2.amazonaws.com
body: {}
timeUnixNano: "1545274780000000000"
- attributes:
- key: network.protocol.name
value:
stringValue: tls
- key: network.protocol.version
value:
stringValue: "2.0"
- key: client.address
value:
stringValue: 72.21.218.154
- key: client.port
value:
intValue: "51341"
- key: destination.address
value:
stringValue: 172.100.100.185
- key: destination.port
value:
intValue: "443"
- key: http.request.size
value:
intValue: "98"
- key: http.response.size
value:
intValue: "246"
- key: aws.elb.tls.listener.resource_id
value:
stringValue: g3d4b5e8bb8464cd
- key: tls.protocol.version
value:
stringValue: tlsv12
- key: tls.cipher
value:
stringValue: ECDHE-RSA-AES128-SHA
- key: aws.elb.connection_time
value:
intValue: "5"
- key: aws.elb.tls_handshake_time
value:
intValue: "2"
- key: aws.elb.incoming_tls_alert
value:
stringValue: '-'
- key: aws.elb.tls_named_group
value:
stringValue: '-'
- key: aws.elb.chosen_cert_arn
value:
stringValue: arn:aws:acm:us-east-2:671290407336:certificate/2a108f19-aded-46b0-8493-c63eb1ef4a99
- key: aws.elb.chosen_cert_serial
value:
stringValue: '-'
- key: aws.elb.alpn_fe_protocol
value:
stringValue: h2
- key: aws.elb.alpn_be_protocol
value:
stringValue: h2
- key: aws.elb.alpn_client_preference_list
value:
stringValue: h2
- key: aws.elb.tls_connection_creation_time
value:
stringValue: ',"http/1.1"'
- key: url.domain
value:
stringValue: my-network-loadbalancer-c6e77e28c25b2234.elb.us-east-2.amazonaws.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,16 @@ func (f *elbAccessLogUnmarshaler) addToNLBAccessLogs(resourceAttr *resourceAttri
recordLog.Attributes().PutStr(AttributeTLSListenerResourceID, nlbRecord.Listener)
recordLog.Attributes().PutStr(string(conventions.TLSProtocolVersionKey), nlbRecord.TLSProtocolVersion)
recordLog.Attributes().PutStr(string(conventions.TLSCipherKey), nlbRecord.TLSCipher)
recordLog.Attributes().PutInt(AttributeELBConnectionTime, nlbRecord.ConnectionTime)
recordLog.Attributes().PutInt(AttributeELBTLSHandshakeTime, nlbRecord.TLSHandshakeTime)
recordLog.Attributes().PutStr(AttributeELBIncomingTLSAlert, nlbRecord.IncomingTLSAlert)
recordLog.Attributes().PutStr(AttributeELBTLSNamedGroup, nlbRecord.TLSNamedGroup)
recordLog.Attributes().PutStr(AttributeELBChosenCertARN, nlbRecord.ChosenCertARN)
recordLog.Attributes().PutStr(AttributeELBChosenCertSerial, nlbRecord.ChosenCertSerial)
recordLog.Attributes().PutStr(AttributeALPNFeProtocol, nlbRecord.ALPNFeProtocol)
recordLog.Attributes().PutStr(AttributeALPNBeProtocol, nlbRecord.ALPNBeProtocol)
recordLog.Attributes().PutStr(AttributeALPNClientPreferenceList, nlbRecord.ALPNClientPreferenceList)
recordLog.Attributes().PutStr(AttributeELBTLSConnectionCreationTime, nlbRecord.TLSConnectionCreationTime)
if nlbRecord.DomainName != unknownField {
recordLog.Attributes().PutStr(string(conventions.URLDomainKey), nlbRecord.DomainName)
}
Expand Down