Skip to content

Fix Graphite Tag integration#131

Open
sarthaksin1857 wants to merge 2 commits intoapache:masterfrom
sarthaksin1857:fix-graphite-datagen
Open

Fix Graphite Tag integration#131
sarthaksin1857 wants to merge 2 commits intoapache:masterfrom
sarthaksin1857:fix-graphite-datagen

Conversation

@sarthaksin1857
Copy link

@sarthaksin1857 sarthaksin1857 commented Feb 22, 2026

#24

What

  • Change example image to alpine and install bash/curl (datagen was not working when curl was uncommented)
  • Make all fields optional with default values in GraphiteEvent

Proof it works

With the graphite example in the repo, we now see

time                       run    branch       version    commit      throughput    response_time    cpu_usage
-------------------------  -----  -----------  ---------  --------  ------------  ---------------  -----------
2026-02-24 04:29:10 +0000         new-feature  0.0.1      p7q8r9           61160               87          0.2
2026-02-24 04:30:10 +0000         new-feature  0.0.1      m4n5o6           60160               85          0.3
2026-02-24 04:31:10 +0000         new-feature  0.0.1      j1k2l3           60960               89          0.1
                                                                    ············                   ···········  
                                                                           -5.6%                       +300.0%  
                                                                    ············                   ···········  
2026-02-24 04:32:10 +0000         new-feature  0.0.1      g7h8i9           57123               88          0.8
2026-02-24 04:33:10 +0000         new-feature  0.0.1      d4e5f6           57980               87          0.9
2026-02-24 04:34:10 +0000         new-feature  0.0.1      a1b2c3           56950               85          0.7

Which makes sense as we do not set run but we do set everything else

Fix data generation script to send required fields

nit

remove non graphite changes

nit

Add datagen changes

Fails still but can deploy local code

Set defaults for all variables and manually specify pub_time

Add table on supported metadata field

nit

Only confirm pub_time is set properly
documentation fixup
@sarthaksin1857 sarthaksin1857 marked this pull request as ready for review February 24, 2026 04:40
@sarthaksin1857
Copy link
Author

@Gerrrr Can you take a look here

Copy link
Contributor

@Gerrrr Gerrrr left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR, @sarthaksin1857 ! I found a few things we need to fix before it is ready to merge. Also, given the wealth of subtle issues, this class may deserve a few unit tests.

filter data by commit or version using `--since-commit` or `--since-version` selectors.

#### Supported Metadata Schema
The following keys are supported within the `data` dictionary:
Copy link
Contributor

Choose a reason for hiding this comment

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

It may not be clear what is the data dictionary in this case. In the paragraph above, we talk about tags, so I suggest replacing this statement with The following tags are supported:

branch: Optional[str]
commit: Optional[str]

def __init__(
Copy link
Contributor

Choose a reason for hiding this comment

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

there is something funky going on with indentation. Intelij highlights edits in this commit differently from the rest of the file:

Image Image

if isinstance(self.pub_time, str):
self.pub_time = parse_datetime(self.pub_time)
elif isinstance(self.pub_time, (int, float)):
self.pub_time = datetime.fromtimestamp(self.pub_time)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change uses a different parsing logic than parse_datetime. The latter does dateparser.parse(date, settings={"RETURN_AS_TIMEZONE_AWARE": True}).

Why do need these extra manipulations with pub_time? I don't follow how making fields optional required it.

self.version = None
else:
self.version = version
if len(branch) == 0 or branch == "null":
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic was lost in this PR. If a string text is empty or equal to "null", we still want to treat it as empty, unless there is a reason not to.

end_time: int,
version: Optional[str],
branch: Optional[str],
commit: Optional[str],
Copy link
Contributor

Choose a reason for hiding this comment

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

idea (maybe outside of scope of this PR): today, if we have other event tags like "environment": "prod", we'll crash with unexpected keyword argument. Maybe we can change this class such that it'd work arbitrary tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants