Attribute service provides CRUD operations for the attributes in Hypertrace.
An attribute is a granular piece of information that is present in Hypertrace and available for querying/displaying in the UI. An attribute encapsulates information like 1) the type of the data, 2) kind of aggregations allowed on it, 3) underlying service/source that can serve this data etc. This helps in building a generic framework of communication between the UI and the backend and also assists the backend to fetch data from the appropriate sources in a generic way.
Ex.
key: apiName,
value_kind: TYPE_STRING,
groupable : true,
display_name: Endpoint Name,
scope: API_TRACE,
sources: [QS],
type: ATTRIBUTE
While hypertrace offers a simple service model, it also permits storing certain fields in different backends. Attributes include tags to help locate the service hosting their corresponding data.
For example, apiName
is generated from raw trace data streams. sources: [QS]
communicates this, as Query Service is the api that queries that data (via Pinot).
You can check out structure of attribute here.
An initial list of attributes needed by Hypertrace are seeded from helm/configs
but they can also be dynamically registered and queried using the APIs of AttributeService.
Attribute service is a part of query architecture in Hypertrace and here is the use of it in context of its callers: hypertrace-graphql and gateway-service.
Hypertrace Query Architecture |
Attribute service fetches all attributes relevant to the scope of what is being shown on UI from Mongo and where it also stores attributes. All of this metadata assists the UI and backend to perform things in a generic fashion, like
- All String attributes in the UI can have a different look at feel and also different operations that can be supported on them(in the explorer).
- The backend also uses part of the information(like the sources) to figure out where to fetch data from i.e. query-service vs entity-service.
The Attribute service uses gradlew to compile/install/distribute. Gradle wrapper is already part of the source code. To build Attribute Service, run:
./gradlew dockerBuildImages
Run ./gradlew test
to execute unit tests.
Run ./gradlew integrationTest
to execute integration tests.
To test your image using the docker-compose setup follow the steps:
- Commit you changes to a branch say
attribute-service-test
. - Go to hypertrace-service and checkout the above branch in the submodule.
cd attribute-service && git checkout attribute-service-test && cd ..
- Change tag for
hypertrace-service
from:main
to:test
in docker-compose file like this.
hypertrace-service:
image: hypertrace/hypertrace-service:test
container_name: hypertrace-service
...
- and then run
docker-compose up
to test the setup.
Add image repository and tag in values.yaml file here like below and then run ./hypertrace.sh install
again and you can test your image!
attribute-service:
image:
repository: "hypertrace/attribute-service"
tagOverride: "test"