When you are studying custom metrics, you will understand how they capture certain application-specific data and certain client-specific side system data. With custom metrics, you can also create metrics that are based on log entries content. Let’s understand about what scope applies to custom metrics?

So if you want to learn more about what scope applies to custom metrics then keep on scrolling through this article. 

What Scope Applies To Custom Metrics? 

what scope applies to custom metrics?

If you are appearing for an exam for Google Analytics, then you will be asked the following question, “What scope applies to Custom Metrics?” For this question you will have the following options, given below:

  • User
  • Hit
  • Event 
  • Session

Here, the right answer will be: Hit.

Read More: Pros And Cons Of Google Analytics 

Understanding Custom Metrics

“Custom metrics, also known as application-specific metrics, let you define and collect information the built-in loud Monitoring metrics cannot. You capture such metrics by using an API provided by a library to instrument your code, and then you send the metrics to a backend application like Cloud Monitoring.”
When we are talking about custom metrics, it can have numerous scopes just like Custom Dimensions. As per Google, “Scope determines which hits will be associated with a particular custom-dimension value.”
With Custom Dimensions, the hit-level scope applies “its value to the hit with which the value was set.” At the same time, “Custom Dimensions with product-level scope will only apply value to the product with which the value was set.” 

Metric Descriptors For Custom Metrics

what scope applies to custom metrics?

It is important that there is a metrics descriptor with every metric type, this way it is how each metric data is organized. It is important to understand that the labels that are there for metrics and also metrics are defined properly in the metric descriptor. 

With Cloud Monitoring, you are capable of creating metric descriptors for yourself if you use metric data. At the same time, you can create certain metric descriptors and after that, you can write the metric data. If this is the case, then it is important that you organize all of your metric data. 

Names Of Custom Metrics

When you are in the process of creating your own custom metrics, it is important that you define the metric type by a string of identifiers. The strings should be unique for your custom metrics for your Google Cloud project

While monitoring, the prefixes that you can use are such as external.googleapis.com/user, custom.googleapis.com/, and also external.googleapis.com/prometheus. It is important that you understand that an identifier is available in two distinct types when it comes to metric types, which are 

  • custom.googleapis.com/instance/cpu/utilization
  • custom.googleapis.com/cpu_utilization

Monitored-Resource Types For Custom Metrics

what scope applies to custom metrics?

It is important for you to know that when you are writing a time series data, you must explain or explain where the data is coming from. To be more specific about the exact source of the data, you can utilize a more monitored resource. 

Well, you should understand that the monitored resource is not a part of the metric type. The metric type describes the data while on the other hand, the monitored resource generally describes exactly where the data originates. 

  • dataflow_job: Dataflow job
  • gce_instance: Compute Engine instance
  • aws_ec2_instance: Amazon EC2 instance
  • gae_instance:  App Engine instance
  • generic_node: User-specified computing node
  • gke_ container: GKE container instance
  • generic_task: User-defined task
  • global: This is used when other resource types are not used.
  • k8s_container: Kubernetes container
  • k8s_cluster: Kubernetes cluster
  • k8s_pod: Kubernetes pod
  • k8s_ node:  Kubernetes node.

To make your work easier, you can run a code using the monitored resource object, which is known to represent physical resources. There are several advantages to this approach, which are.

  • Compared to a single resource type, you can perform better. 
  • You can be forgetting about the multiple processes working together at the time. 
  • You can also use a group of custom-metric data with metric data, which are coming from the same source. 

API Methods That Support Custom Metrics

In the table given below, the method for Monitoring API supports custom metrics, and also the method to build metrics is given. 

Monitoring the API methodUse with custom metricsUse with built-in metrics
monitoredResourceDescriptors.getyesyes
monitoredResourceDescriptors.listyesyes
metricDescriptors.getyesyes
metricsDescriptors.listyesyes
timeSeries.listyesyes
timeSeries.createyes
metricsDescriptors.createyes
metricDescriptors.deleteyes

Read More: Which Default Traffic Source Dimensions Does Google Analytics Report For Each Website Visitor

Wrapping Up!

Now that we have discussed what scope applies to custom metrics and understood what custom metrics are. So if you feel like you understand what custom metrics are then don’t forget to give us a like and comment down below, if you want more articles like these.

Read Also:

Nabamita Sinha

Nabamita Sinha loves to write about lifestyle and pop-culture. In her free time, she loves to watch movies and TV series and experiment with food. Her favorite niche topics are fashion, lifestyle, travel, and gossip content. Her style of writing is creative and quirky.

View all Posts

Leave a Reply

Your email address will not be published. Required fields are marked *