-
Notifications
You must be signed in to change notification settings - Fork 342
Eventing Stackdriver integration #612
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
4 commits
Select commit
Hold shift + click to select a range
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| /* | ||
| Copyright 2019 The Knative Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package metricskey | ||
|
|
||
| import "k8s.io/apimachinery/pkg/util/sets" | ||
|
|
||
| // TODO should be moved to eventing. See https://github.com/knative/pkg/issues/608 | ||
|
|
||
| const ( | ||
| // ResourceTypeKnativeTrigger is the Stackdriver resource type for Knative Triggers. | ||
| ResourceTypeKnativeTrigger = "knative_trigger" | ||
|
|
||
| // ResourceTypeKnativeBroker is the Stackdriver resource type for Knative Brokers. | ||
| ResourceTypeKnativeBroker = "knative_broker" | ||
|
|
||
| // ResourceTypeKnativeImporter is the Stackdriver resource type for Knative Importers. | ||
| ResourceTypeKnativeImporter = "knative_importer" | ||
|
|
||
| // LabelTriggerName is the label for the name of the Trigger. | ||
| LabelTriggerName = "trigger_name" | ||
|
|
||
| // LabelBrokerName is the label for the name of the Broker. | ||
| LabelBrokerName = "broker_name" | ||
|
|
||
| // LabelEventType is the label for the name of the event type. | ||
| LabelEventType = "event_type" | ||
|
|
||
| // LabelEventSource is the label for the name of the event source. | ||
| LabelEventSource = "event_source" | ||
|
|
||
| // LabelFilterType is the label for the Trigger filter attribute "type". | ||
| LabelFilterType = "filter_type" | ||
|
|
||
| // LabelFilterSource is the label for the Trigger filter attribute "source". | ||
| LabelFilterSource = "filter_source" | ||
|
|
||
| // LabelImporterName is the label for the name of the Importer. | ||
| LabelImporterName = "importer_name" | ||
|
|
||
| // LabelImporterResourceGroup is the name of the Importer CRD. | ||
| LabelImporterResourceGroup = "importer_resource_group" | ||
| ) | ||
|
|
||
| var ( | ||
| // KnativeTriggerLabels stores the set of resource labels for resource type knative_trigger. | ||
| KnativeTriggerLabels = sets.NewString( | ||
| LabelProject, | ||
| LabelLocation, | ||
| LabelClusterName, | ||
| LabelNamespaceName, | ||
| LabelTriggerName, | ||
| LabelBrokerName, | ||
| ) | ||
|
|
||
| // KnativeTriggerMetrics stores a set of metric types which are supported | ||
| // by resource type knative_trigger. | ||
| KnativeTriggerMetrics = sets.NewString( | ||
| "knative.dev/eventing/trigger/event_count", | ||
| "knative.dev/eventing/trigger/event_processing_latencies", | ||
| "knative.dev/eventing/trigger/event_dispatch_latencies", | ||
| ) | ||
|
|
||
| // KnativeBrokerLabels stores the set of resource labels for resource type knative_broker. | ||
| KnativeBrokerLabels = sets.NewString( | ||
| LabelProject, | ||
| LabelLocation, | ||
| LabelClusterName, | ||
| LabelNamespaceName, | ||
| LabelBrokerName, | ||
| ) | ||
|
|
||
| // KnativeBrokerMetrics stores a set of metric types which are supported | ||
| // by resource type knative_trigger. | ||
| KnativeBrokerMetrics = sets.NewString( | ||
| "knative.dev/eventing/broker/event_count", | ||
| ) | ||
|
|
||
| // KnativeImporterLabels stores the set of resource labels for resource type knative_importer. | ||
| KnativeImporterLabels = sets.NewString( | ||
| LabelProject, | ||
| LabelLocation, | ||
| LabelClusterName, | ||
| LabelNamespaceName, | ||
| LabelImporterName, | ||
| LabelImporterResourceGroup, | ||
| ) | ||
|
|
||
| // KnativeImporterMetrics stores a set of metric types which are supported | ||
| // by resource type knative_importer. | ||
| KnativeImporterMetrics = sets.NewString( | ||
| "knative.dev/eventing/importer/event_count", | ||
| ) | ||
| ) | ||
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,68 @@ | ||
| /* | ||
| Copyright 2019 The Knative Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package metricskey | ||
|
|
||
| import "k8s.io/apimachinery/pkg/util/sets" | ||
|
|
||
| // TODO should be moved to serving. See https://github.com/knative/pkg/issues/608 | ||
|
|
||
| const ( | ||
| // ResourceTypeKnativeRevision is the Stackdriver resource type for Knative revision | ||
| ResourceTypeKnativeRevision = "knative_revision" | ||
|
|
||
| // LabelServiceName is the label for the deployed service name | ||
| LabelServiceName = "service_name" | ||
|
|
||
| // LabelRouteName is the label for immutable name of the route that receives the request | ||
| LabelRouteName = "route_name" | ||
|
|
||
| // LabelConfigurationName is the label for the configuration which created the monitored revision | ||
| LabelConfigurationName = "configuration_name" | ||
|
|
||
| // LabelRevisionName is the label for the monitored revision | ||
| LabelRevisionName = "revision_name" | ||
| ) | ||
|
|
||
| var ( | ||
| // KnativeRevisionLabels stores the set of resource labels for resource type knative_revision. | ||
| // LabelRouteName is added as extra label since it is optional, not in this map. | ||
| KnativeRevisionLabels = sets.NewString( | ||
| LabelProject, | ||
| LabelLocation, | ||
| LabelClusterName, | ||
| LabelNamespaceName, | ||
| LabelServiceName, | ||
| LabelConfigurationName, | ||
| LabelRevisionName, | ||
| ) | ||
|
|
||
| // KnativeRevisionMetrics stores a set of metric types which are supported | ||
| // by resource type knative_revision. | ||
| KnativeRevisionMetrics = sets.NewString( | ||
| "knative.dev/serving/activator/request_count", | ||
| "knative.dev/serving/activator/request_latencies", | ||
| "knative.dev/serving/autoscaler/desired_pods", | ||
| "knative.dev/serving/autoscaler/requested_pods", | ||
| "knative.dev/serving/autoscaler/actual_pods", | ||
| "knative.dev/serving/autoscaler/stable_request_concurrency", | ||
| "knative.dev/serving/autoscaler/panic_request_concurrency", | ||
| "knative.dev/serving/autoscaler/target_concurrency_per_pod", | ||
| "knative.dev/serving/autoscaler/panic_mode", | ||
| "knative.dev/serving/revision/request_count", | ||
| "knative.dev/serving/revision/request_latencies", | ||
| ) | ||
| ) |
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.