Skip to content
Merged
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/iisreceiver-add-application_pool-metrics.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. filelogreceiver)
component: iisreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Added state and uptime metrics for application pools

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

# (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: [user]
26 changes: 26 additions & 0 deletions receiver/iisreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,32 @@ The amount of time the server has been up.
| ---- | ----------- | ---------- |
| s | Gauge | Int |

## Optional Metrics

The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:

```yaml
metrics:
<metric_name>:
enabled: true
```

### iis.application_pool.state

The current state of the application pool. (0 - Starting, 1 - Started, 2 - Stopping, 3 - Stopped, 4 - Unknown)

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {state} | Gauge | Int |

### iis.application_pool.uptime

The application pools uptime period since the last restart.

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {ms} | Gauge | Int |

## Resource Attributes

| Name | Description | Values | Enabled |
Expand Down
8 changes: 8 additions & 0 deletions receiver/iisreceiver/internal/metadata/generated_config.go

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

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

114 changes: 114 additions & 0 deletions receiver/iisreceiver/internal/metadata/generated_metrics.go

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

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

8 changes: 8 additions & 0 deletions receiver/iisreceiver/internal/metadata/testdata/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
default:
all_set:
metrics:
iis.application_pool.state:
enabled: true
iis.application_pool.uptime:
enabled: true
iis.connection.active:
enabled: true
iis.connection.anonymous:
Expand Down Expand Up @@ -32,6 +36,10 @@ all_set:
enabled: true
none_set:
metrics:
iis.application_pool.state:
enabled: false
iis.application_pool.uptime:
enabled: false
iis.connection.active:
enabled: false
iis.connection.anonymous:
Expand Down
12 changes: 12 additions & 0 deletions receiver/iisreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,15 @@ metrics:
gauge:
value_type: int
enabled: true
iis.application_pool.state:
description: The current state of the application pool. (0 - Starting, 1 - Started, 2 - Stopping, 3 - Stopped, 4 - Unknown)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

unit: "{state}"
gauge:
value_type: int
enabled: false
iis.application_pool.uptime:
description: The application pools uptime period since the last restart.
unit: "{ms}"
gauge:
value_type: int
enabled: false
12 changes: 12 additions & 0 deletions receiver/iisreceiver/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ var appPoolPerfCounterRecorders = []perfCounterRecorderConf{
},
},
},
{
object: "APP_POOL_WAS",
instance: "*",
recorders: map[string]recordFunc{
"Current Application Pool State": func(mb *metadata.MetricsBuilder, ts pcommon.Timestamp, val float64) {
mb.RecordIisApplicationPoolStateDataPoint(ts, int64(val))
},
"Current Application Pool Uptime": func(mb *metadata.MetricsBuilder, ts pcommon.Timestamp, val float64) {
mb.RecordIisApplicationPoolUptimeDataPoint(ts, int64(val))
},
},
},
}

func recordMaxQueueItemAge(mb *metadata.MetricsBuilder, ts pcommon.Timestamp, val float64) {
Expand Down