Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fleet Detection Plugin #6151

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
77 changes: 77 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ dependencies = [
"static_assertions",
"strum_macros 0.26.4",
"sys-info",
"sysinfo",
"tempfile",
"test-log",
"thiserror",
Expand Down Expand Up @@ -4175,6 +4176,15 @@ dependencies = [
"windows-sys 0.48.0",
]

[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]

[[package]]
name = "nu-ansi-term"
version = "0.46.0"
Expand Down Expand Up @@ -6355,6 +6365,20 @@ dependencies = [
"libc",
]

[[package]]
name = "sysinfo"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b5ae3f4f7d64646c46c4cae4e3f01d1c5d255c7406fdd7c7f999a94e488791"
dependencies = [
"core-foundation-sys",
"libc",
"memchr",
"ntapi",
"rayon",
"windows",
]

[[package]]
name = "system-configuration"
version = "0.5.1"
Expand Down Expand Up @@ -7527,6 +7551,59 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

[[package]]
name = "windows"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
dependencies = [
"windows-core",
"windows-targets 0.52.6",
]

[[package]]
name = "windows-core"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
dependencies = [
"windows-implement",
"windows-interface",
"windows-result",
"windows-targets 0.52.6",
]

[[package]]
name = "windows-implement"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.76",
]

[[package]]
name = "windows-interface"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.76",
]

[[package]]
name = "windows-result"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
dependencies = [
"windows-targets 0.52.6",
]

[[package]]
name = "windows-sys"
version = "0.45.0"
Expand Down
1 change: 1 addition & 0 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ serde_yaml = "0.8.26"
static_assertions = "1.1.0"
strum_macros = "0.26.0"
sys-info = "0.9.1"
sysinfo = { version = "0.32.0", features = ["windows"] }
thiserror = "1.0.61"
tokio.workspace = true
tokio-stream = { version = "0.1.15", features = ["sync", "net"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,9 @@ expression: "&schema"
"type": "object"
},
"Conf5": {
"type": "object"
},
"Conf6": {
"anyOf": [
{
"additionalProperties": {
Expand All @@ -1277,7 +1280,7 @@ expression: "&schema"
],
"description": "Subgraph URL mappings"
},
"Conf6": {
"Conf7": {
"additionalProperties": false,
"description": "Configuration for the Rhai Plugin",
"properties": {
Expand All @@ -1294,7 +1297,7 @@ expression: "&schema"
},
"type": "object"
},
"Conf7": {
"Conf8": {
"additionalProperties": false,
"description": "Telemetry configuration",
"properties": {
Expand Down Expand Up @@ -8323,6 +8326,10 @@ expression: "&schema"
"description": "Type conditioned fetching configuration.",
"type": "boolean"
},
"fleet_detector": {
"$ref": "#/definitions/Conf5",
"description": "#/definitions/Conf5"
},
"forbid_mutations": {
"$ref": "#/definitions/ForbidMutationsConfig",
"description": "#/definitions/ForbidMutationsConfig"
Expand All @@ -8348,8 +8355,8 @@ expression: "&schema"
"description": "#/definitions/Config"
},
"override_subgraph_url": {
"$ref": "#/definitions/Conf5",
"description": "#/definitions/Conf5"
"$ref": "#/definitions/Conf6",
"description": "#/definitions/Conf6"
},
"persisted_queries": {
"$ref": "#/definitions/PersistedQueries",
Expand All @@ -8372,8 +8379,8 @@ expression: "&schema"
"description": "#/definitions/Config8"
},
"rhai": {
"$ref": "#/definitions/Conf6",
"description": "#/definitions/Conf6"
"$ref": "#/definitions/Conf7",
"description": "#/definitions/Conf7"
},
"sandbox": {
"$ref": "#/definitions/Sandbox",
Expand All @@ -8388,8 +8395,8 @@ expression: "&schema"
"description": "#/definitions/Supergraph"
},
"telemetry": {
"$ref": "#/definitions/Conf7",
"description": "#/definitions/Conf7"
"$ref": "#/definitions/Conf8",
"description": "#/definitions/Conf8"
},
"tls": {
"$ref": "#/definitions/Tls",
Expand Down
3 changes: 1 addition & 2 deletions apollo-router/src/metrics/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl FilterMeterProvider {
.delegate(delegate)
.allow(
Regex::new(
r"apollo\.(graphos\.cloud|router\.(operations?|lifecycle|config|schema|query|query_planning|telemetry))(\..*|$)|apollo_router_uplink_fetch_count_total|apollo_router_uplink_fetch_duration_seconds",
r"apollo\.(graphos\.cloud|router\.(operations?|lifecycle|config|schema|query|query_planning|telemetry|instance))(\..*|$)|apollo_router_uplink_fetch_count_total|apollo_router_uplink_fetch_duration_seconds",
)
.expect("regex should have been valid"),
)
Expand Down Expand Up @@ -244,7 +244,6 @@ impl opentelemetry::metrics::MeterProvider for FilterMeterProvider {

#[cfg(test)]
mod test {

use opentelemetry::metrics::MeterProvider;
use opentelemetry::metrics::Unit;
use opentelemetry::runtime;
Expand Down
Loading
Loading