How Hatica API Works
The Hatica API allows you to interact with the platform by sending deployment events and receiving computed metrics. The API processes the data on the fly and retains only the computed metrics, ensuring that your workflows remain efficient.
Key Points to Remember:
- Repository Information: If you do not pass a service name in the API and just pass the repository information, Hatica auto-creates the service if it is not already present.
- Commit SHA: Make sure the "id" field is set to the SHA of the commit that was actually deployed.
- Repository Path: The repository name should include only the path and exclude the protocol (i.e., "https:").
- Latency: It typically takes 1-2 minutes for the deployment data to reflect on the dashboard after an API call.
When you send a deployment event, Hatica captures the relevant data, computes the necessary metrics, and displays them on your dashboard. This helps in monitoring and analyzing your deployment metrics effectively.
Hatica can also auto-create services based on the repository information if no service name is provided. This feature streamlines the setup process and eliminates the need to manually create a service each time a new repository is created.
API Types:
A. Product API: This API allows you to read metrics and manage your dashboards and configuration.
B. Events API: This API allows you to send work and system activity as events (e.g., deployment events to support DORA metrics) to calculate custom metrics and support tools Hatica does not directly integrate with.
Accessing the APIs:
- To access the APIs, you will need an API key. Visit the API section in your app under the Configuration menu to manage keys and access logs.
- Ensure your plan includes API access.
FAQ
Why are the deployment events not reflecting data in the Services or DORA dashboard?
- Latency: It usually takes up to 1 minute for the deployment data to be reflected in the dashboard.
- Commit SHA: Ensure the "id" field is set to the SHA of the commit that was actually deployed.
- Repository Match: The repository specified in the payload should be the same repository against which the service was configured.
- Repository Path: The repository name should only include the path and should exclude the protocol.
Is it possible to track an old PR as deployed if the deployment was reported to Hatica via API?
Answer: For deployments reported to Hatica via API, there is no way to retrospectively track PRs released in the very first deployment. Therefore, only PRs from the same date or future are considered for the first deployment.
Resolution: Send a dummy or blank first deployment for each service to initialize tracking. This needs to be done only once for each new service.
What is the latency from API call to deployment reflecting on the dashboard?
The latency is typically between 1-2 minutes. The API operates asynchronously, and for the data to reflect correctly, the SHA and repository names must match. Incorrect details may prevent the deployment from appearing on the dashboard.
Why is the team/individual filter not working, even though the release contains a PR from a specific team/individual?
The mapping of deployments to PRs can take time, depending on when the data is pulled. If you recently deployed, the data may still be syncing with your Version Control System (VCS), causing a delay in the appearance of PR data. Depending on the size of the repository, it could take up to 48 hours.