Skip to content

Commit

Permalink
fix(otel receiver): Rename varnish attribute (#305)
Browse files Browse the repository at this point in the history
* rename attribute

* update attribute value
  • Loading branch information
JonathanWamsley authored Mar 22, 2022
1 parent f7c9ebc commit b435e53
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 387 deletions.
4 changes: 2 additions & 2 deletions receiver/varnishreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These are the metrics available for this scraper.
| **varnish.backend.connections.count** | The backend connection type count. | {connections} | Sum(Int) | <ul> <li>backend_connection_type</li> </ul> |
| **varnish.backend.requests.count** | The backend requests count. | {requests} | Sum(Int) | <ul> </ul> |
| **varnish.cache.operations.count** | The cache operation type count. | {operations} | Sum(Int) | <ul> <li>cache_operations</li> </ul> |
| **varnish.client.requests.count** | The client request count. | {requests} | Sum(Int) | <ul> <li>client_requests</li> </ul> |
| **varnish.client.requests.count** | The client request count. | {requests} | Sum(Int) | <ul> <li>state</li> </ul> |
| **varnish.object.count** | The HTTP objects in the cache count. | {objects} | Sum(Int) | <ul> </ul> |
| **varnish.object.expired.count** | The expired objects from old age count. | {objects} | Sum(Int) | <ul> </ul> |
| **varnish.object.moved.count** | The moved operations done on the LRU list count. | {objects} | Sum(Int) | <ul> </ul> |
Expand All @@ -35,6 +35,6 @@ metrics:
| backend_connection_type | The backend connection types. |
| cache_name | The varnish cache name. |
| cache_operations | The cache operation types |
| client_requests | The client request types. |
| session_type | The session connection types. |
| state | The client request states. |
| thread_operations | The thread operation types. |
32 changes: 16 additions & 16 deletions receiver/varnishreceiver/internal/metadata/generated_metrics_v2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions receiver/varnishreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ attributes:
value: kind
description: The session connection types.
enum: [accepted, dropped, failed]
client_requests:
value: kind
description: The client request types.
state:
value: state
description: The client request states.
enum: [received, dropped]

metrics:
Expand Down Expand Up @@ -105,7 +105,7 @@ metrics:
value_type: int
monotonic: true
aggregation: cumulative
attributes: [client_requests]
attributes: [state]
varnish.backend.requests.count:
enabled: true
description: The backend requests count.
Expand Down
4 changes: 2 additions & 2 deletions receiver/varnishreceiver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func (v *varnishScraper) recordVarnishSessionCountDataPoint(now pdata.Timestamp,

func (v *varnishScraper) recordVarnishClientRequestsCountDataPoint(now pdata.Timestamp, stats *Stats) {
attributeMappings := map[string]int64{
metadata.AttributeClientRequests.Received: stats.MAINClientReq.Value,
metadata.AttributeClientRequests.Dropped: stats.MAINReqDropped.Value,
metadata.AttributeState.Received: stats.MAINClientReq.Value,
metadata.AttributeState.Dropped: stats.MAINReqDropped.Value,
}

for attributeName, attributeValue := range attributeMappings {
Expand Down
Loading

0 comments on commit b435e53

Please sign in to comment.