Repository navigation
Show CollectionDeclaration feedback under Agent #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f16b23
Present ResourceCollection selection feedback in Kubernetes CRD topology
aacevedoosorio 0c5cebd
Keep ResourceCollection StackPack changes focused on content
aacevedoosorio dfb42de
Clarify collection declaration overview
aacevedoosorio 7e5cb6a
Move collection declarations to the Agent menu
aacevedoosorio 13baa28
Merge remote-tracking branch 'origin/main' into sts-828-kind-menu
aacevedoosorio 4fd0a02
Match CollectionDeclaration naming and place Agent last
aacevedoosorio 0308d15
Include collection declarations in the custom resource inventory
aacevedoosorio d5cc0c6
Reuse the SUSE Geeko icon for the Agent menu
aacevedoosorio fd52770
Let declaration and generic resource mappings merge
aacevedoosorio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| nodes: | ||
| - _type: MainMenuGroup | ||
| name: Open Telemetry | ||
| order: 0 | ||
| iconbase64: !icon open-telemetry.svg | ||
| defaultOpen: true | ||
| items: [] | ||
| identifier: "urn:stackpack:open-telemetry:main-menu-group:open-telemetry" | ||
| identifier: "urn:stackpack:open-telemetry:main-menu-group:open-telemetry" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
stackpacks/otel-k8s-crd/settings/component-mappings/collection-declarations.sty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| nodes: | ||
| - _type: "OtelComponentMapping" | ||
| name: "Kubernetes Collection Declaration" | ||
| description: "Collection declarations and their generation-bound feedback" | ||
| identifier: "urn:stackpack:otel-k8s-crd:otel-component-mapping:collection-declaration" | ||
| input: | ||
| signal: | ||
| - "LOGS" | ||
| resource: | ||
| scope: | ||
| log: | ||
| action: "log.body['type'] in ['ADDED', 'MODIFIED'] ? 'CREATE' : log.body['type'] == 'DELETED' ? 'DELETE' : 'CONTINUE'" | ||
| condition: >- | ||
| log.eventName == 'KubernetesCustomResourceEvent' && | ||
| log.attributes['k8s.resource.group'] == 'observability.suse.com' && | ||
| log.attributes['k8s.resource.kind'] == 'CollectionDeclaration' | ||
| vars: | ||
| - name: "clusterName" | ||
| value: "resource.attributes['k8s.cluster.name']" | ||
| - name: "name" | ||
| value: "log.attributes['k8s.object.name']" | ||
| - name: "object" | ||
| value: "log.body['object']" | ||
| - name: "status" | ||
| value: "'status' in log.body['object'] ? log.body['object']['status'] : {}" | ||
| - name: "readyConditions" | ||
| value: >- | ||
| 'status' in log.body['object'] && 'conditions' in log.body['object']['status'] | ||
| ? log.body['object']['status']['conditions'].filter(c, c['type'] == 'Ready') | ||
| : [] | ||
| - name: "current" | ||
| value: >- | ||
| 'generation' in log.body['object']['metadata'] && | ||
| log.body['object']['metadata']['generation'] > 0 && | ||
| 'status' in log.body['object'] && | ||
| 'observedGeneration' in log.body['object']['status'] && | ||
| log.body['object']['status']['observedGeneration'] == log.body['object']['metadata']['generation'] && | ||
| 'conditions' in log.body['object']['status'] && | ||
| log.body['object']['status']['conditions'].exists(c, | ||
| c['type'] == 'Ready' && 'observedGeneration' in c && | ||
| c['observedGeneration'] == log.body['object']['metadata']['generation']) | ||
| output: | ||
| identifier: "'urn:k8s:cr:/cluster/' + vars.clusterName + ':namespace/:group/observability.suse.com:kind/CollectionDeclaration:name/' + vars.name" | ||
| name: "vars.name" | ||
| typeName: "'custom resource'" | ||
| required: | ||
| configuration: "omit(vars.object, ['status', 'metadata'])" | ||
| tags: | ||
| - source: "'otel-k8s-crd'" | ||
| target: "stackpack" | ||
| - source: "'CollectionDeclaration'" | ||
| target: "k8s.resource.kind" | ||
| - source: "'observability.suse.com'" | ||
| target: "k8s.resource.group" | ||
| - source: "vars.name" | ||
| target: "k8s.resource.name" | ||
| - source: "vars.clusterName" | ||
| target: "cluster-name" | ||
| - source: >- | ||
| !vars.current ? 'Awaiting reconciliation' : | ||
| vars.readyConditions[0]['status'] == 'True' ? 'Collecting' : | ||
| vars.readyConditions[0]['status'] == 'False' | ||
| ? (vars.readyConditions[0]['reason'] == 'ResourcesPending' ? 'Pending' : 'Blocked') | ||
| : 'Unknown' | ||
| target: "k8s.collection.state" | ||
| optional: | ||
| status: "vars.status" | ||
| tags: | ||
| - source: >- | ||
| vars.current ? vars.readyConditions[0]['reason'] : '' | ||
| target: "k8s.collection.reason" | ||
| - source: >- | ||
| vars.current ? vars.readyConditions[0]['message'] | ||
| : 'Waiting for feedback on the current declaration.' | ||
| target: "k8s.collection.message" | ||
| - source: "string(vars.object['metadata']['generation'])" | ||
| target: "k8s.collection.generation" | ||
| - source: "string(vars.status['observedGeneration'])" | ||
| target: "k8s.collection.observed-generation" | ||
| - source: "string(size(vars.object['spec']['resources']))" | ||
| target: "k8s.collection.selections" | ||
| - source: "vars.object['metadata']['creationTimestamp']" | ||
| target: "k8s.creationTimestamp" | ||
| expireAfter: 900000 | ||
| rank: | ||
| specificity: 100 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,15 @@ | ||
| nodes: | ||
| - _type: MainMenuGroup | ||
| name: Kubernetes | ||
| order: 0 | ||
| iconbase64: "" | ||
| defaultOpen: true | ||
| items: [] | ||
| identifier: "urn:stackpack:otel-k8s-crd:main-menu-group:kubernetes" | ||
| - _type: MainMenuGroup | ||
| name: Agent | ||
| order: -1 | ||
| iconbase64: !icon agent.svg | ||
| defaultOpen: false | ||
| items: [] | ||
| identifier: "urn:stackpack:otel-k8s-crd:main-menu-group:agent" |
147 changes: 147 additions & 0 deletions
147
stackpacks/otel-k8s-crd/settings/presentations/collection-declarations.sty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| nodes: | ||
| - _type: ComponentPresentation | ||
| name: "Collection Declaration" | ||
| description: "Presentation for Kubernetes collection declarations" | ||
| identifier: "urn:stackpack:otel-k8s-crd:component-presentation:collection-declaration" | ||
| binding: | ||
| _type: ComponentPresentationQueryBinding | ||
| query: >- | ||
| label = "stackpack:otel-k8s-crd" and label = "source-type:custom resource" | ||
| and label = "k8s.resource.group:observability.suse.com" | ||
| and label = "k8s.resource.kind:CollectionDeclaration" | ||
| rank: | ||
| specificity: 20 | ||
| presentation: | ||
| icon: !icon cr.svg | ||
| filters: | ||
| - filterId: "crd_cluster" | ||
| topology: | ||
| groupingEnabled: true | ||
| showIndirectRelations: false | ||
| minimumGroupSize: 8 | ||
| groupedByLayers: false | ||
| groupedByDomains: true | ||
| autoGrouping: true | ||
| connectedComponents: true | ||
| overview: | ||
| name: | ||
| singular: "collection declaration" | ||
| plural: "collection declarations" | ||
| title: "Collection Declarations" | ||
| mainMenu: | ||
| group: "Agent" | ||
| order: 0 | ||
| columns: | ||
| - columnId: cr_name | ||
| title: "Name" | ||
| projection: | ||
| _type: ComponentLinkProjection | ||
| name: "name" | ||
| identifier: "identifiers[0]" | ||
| - columnId: collection_state | ||
| title: "Collection" | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.state')" | ||
| - columnId: collection_reason | ||
| title: "Reason" | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.reason')" | ||
| - columnId: collection_selections | ||
| title: "Selections" | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.selections')" | ||
| - columnId: cr_cluster | ||
| title: "Cluster" | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('cluster-name')" | ||
| - columnId: cr_age | ||
| title: "Age" | ||
| projection: | ||
| _type: DurationProjection | ||
| startTime: "tags.singleValue('k8s.creationTimestamp')" | ||
| highlight: | ||
| title: "Collection Declaration" | ||
| fields: | ||
| - fieldId: collection_state | ||
| title: "Collection" | ||
| order: 100.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.state')" | ||
| - fieldId: collection_reason | ||
| title: "Reason" | ||
| order: 95.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.reason')" | ||
| - fieldId: collection_message | ||
| title: "Collection details" | ||
| order: 90.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.message')" | ||
| - fieldId: collection_generation | ||
| title: "Declaration generation" | ||
| order: 80.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.generation')" | ||
| - fieldId: collection_observed_generation | ||
| title: "Observed generation" | ||
| order: 75.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.observed-generation')" | ||
| - fieldId: collection_selections | ||
| title: "Selections" | ||
| order: 70.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('k8s.collection.selections')" | ||
| - fieldId: kind | ||
| title: "Kind" | ||
| order: 60.0 | ||
| projection: | ||
| _type: ComponentLinkProjection | ||
| name: "tags.singleValue('k8s.resource.kind')" | ||
| identifier: "'urn:k8s:crd:/cluster/' + tags.singleValue('cluster-name') + ':group/' + tags.singleValue('k8s.resource.group') + ':kind/' + tags.singleValue('k8s.resource.kind')" | ||
| - fieldId: cluster | ||
| title: "Cluster" | ||
| order: 50.0 | ||
| projection: | ||
| _type: TextProjection | ||
| value: "tags.singleValue('cluster-name')" | ||
| - fieldId: age | ||
| title: "Age" | ||
| order: 40.0 | ||
| projection: | ||
| _type: DurationProjection | ||
| startTime: "tags.singleValue('k8s.creationTimestamp')" | ||
| - fieldId: labels | ||
| title: "Labels" | ||
| order: 10.0 | ||
| projection: | ||
| _type: TagProjection | ||
| provisioning: | ||
| topologySourceSelector: "source.identifier == identifiers[0]" | ||
| showConfiguration: true | ||
| showStatus: true | ||
| relatedResources: | ||
| - resourceId: "cr_definition" | ||
| title: "Custom Resource Definition" | ||
| order: 1.0 | ||
| topologyQuery: >- | ||
| (withNeighborsOf(direction = "both", | ||
| components = (identifier = "${identifiers[0]}"), | ||
| levels = "1")) and label = "source-type:custom resource definition" | ||
| presentationIdentifier: "urn:stackpack:otel-k8s-crd:component-presentation:custom-resource-definition" | ||
| events: | ||
| showEvents: true | ||
| relatedResourcesQuery: | | ||
| identifier = "${identifiers[0]}" | ||
| OR | ||
| (withNeighborsOf(direction = "both", components = (identifier = "${identifiers[0]}"), levels = "1") and label = "source-type:custom resource definition") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.