Skip to content

feat: entity labels API #24

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ message Entity {

//attributes that describe the entity (e.g. service labels, service version, lang etc)
map<string, AttributeValue> attributes = 7;
// entity labels
repeated string entity_label_ids = 8;
}

message Entities {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_multiple_files = true;

package org.hypertrace.entity.data.service.v1;

message EntityLabel {
string id = 1;
string name = 2;
// TODO: This is up for debate.
string color = 3;
}

message EntityLabelByIdRequest {
string id = 1;
}

//message Empty {
//}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,40 @@ import "org/hypertrace/entity/query/service/v1/request.proto";
import "org/hypertrace/entity/query/service/v1/response.proto";
import "org/hypertrace/entity/query/service/v1/value.proto";
import "org/hypertrace/entity/query/service/v1/entity_query_request.proto";
import "org/hypertrace/entity/data/service/v1/entity.proto";
import "org/hypertrace/entity/data/service/v1/entity_label.proto";
// TODO: Needed for Empty message
import "org/hypertrace/entity/data/service/v1/entity_data_request.proto";

message EntityIdAndLabelId {
string entity_id = 1;
string entity_label_id = 2;
}

message EntitiesByLabel {
string entity_label_id = 1;
repeated org.hypertrace.entity.data.service.v1.Entity entities = 2;
}

service EntityQueryService {
rpc execute (EntityQueryRequest) returns (stream ResultSetChunk) {
}
rpc update (EntityUpdateRequest) returns (stream ResultSetChunk) {
}

rpc createEntityLabel (org.hypertrace.entity.data.service.v1.EntityLabel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we decided to create labels as first class objects? Do we have notes on why we came to that conclusion?

returns (org.hypertrace.entity.data.service.v1.EntityLabel) {}
rpc getEntityLabel (org.hypertrace.entity.data.service.v1.EntityLabelByIdRequest)
returns (org.hypertrace.entity.data.service.v1.EntityLabel) {}
rpc updateEntityLabel (org.hypertrace.entity.data.service.v1.EntityLabel)
returns (stream org.hypertrace.entity.data.service.v1.EntityLabel) {}
rpc getAllEntityLabels (org.hypertrace.entity.data.service.v1.Empty)
returns (stream org.hypertrace.entity.data.service.v1.EntityLabel) {}

rpc addEntityLabelToEntity (EntityIdAndLabelId)
returns (org.hypertrace.entity.data.service.v1.Entity) {}
rpc removeEntityLabelFromEntity (EntityIdAndLabelId)
returns (org.hypertrace.entity.data.service.v1.Entity) {}
rpc getEntitiesByLabel(org.hypertrace.entity.data.service.v1.Empty)
returns (stream EntitiesByLabel) {}
}