-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(packages): add tracepusher & har-to-otel
- Loading branch information
1 parent
3d0626d
commit 36a2226
Showing
8 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ lib | ||
, python3 | ||
, python3Packages | ||
, fetchFromGitHub | ||
, substituteAll | ||
}: | ||
|
||
python3Packages.buildPythonApplication rec { | ||
pname = "har-to-otel"; | ||
version = "0.9.0"; | ||
format = "setuptools"; | ||
|
||
disabled = python3.pythonOlder "3.11"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "agardnerIT"; | ||
repo = "tracepusher"; | ||
rev = "668053739ee93556f6a121bf0f047514379c4596"; | ||
hash = "sha256-w+xrp2uHoXZQv4YzM1Kmiv2KSlM0iHh1n8OlgUcq0OQ="; | ||
}; | ||
|
||
patches = [ ./shebang.patch ]; | ||
|
||
postPatch = let | ||
setup = substituteAll { | ||
src = ./setup.py; | ||
desc = meta.description; | ||
inherit pname version; | ||
}; | ||
in '' | ||
ln -s ${setup} setup.py | ||
''; | ||
|
||
propagatedBuildInputs = [ | ||
python3Packages.requests | ||
]; | ||
|
||
doCheck = false; | ||
|
||
meta = with lib; { | ||
changelog = "https://github.com/agardnerIT/tracepusher/releases/tag/${version}"; | ||
description = "Chrome DevTools HAR File to OpenTelemetry Converter"; | ||
homepage = "https://github.com/agardnerIT/tracepusher/tree/main/har-to-otel"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ gaelreyrol ]; | ||
mainProgrom = "har-to-otel.py"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
import codecs | ||
import os | ||
from setuptools import setup, find_packages | ||
|
||
def open_local(paths, mode="r", encoding="utf8"): | ||
path = os.path.join(os.path.abspath(os.path.dirname(__file__)), *paths) | ||
return codecs.open(path, mode, encoding) | ||
|
||
with open_local(["requirements.txt"]) as req: | ||
install_requires = req.read().split("\n") | ||
|
||
setup(name='@pname@', | ||
version='@version@', | ||
description='@desc@', | ||
scripts=["har-to-otel/har-to-otel.py"], | ||
packages=find_packages(), | ||
install_requires=install_requires, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/har-to-otel/har-to-otel.py b/har-to-otel/har-to-otel.py | ||
index 135350e..658e6e5 100644 | ||
--- a/har-to-otel/har-to-otel.py | ||
+++ b/har-to-otel/har-to-otel.py | ||
@@ -1,3 +1,5 @@ | ||
+#! /usr/bin/env python | ||
+ | ||
import json | ||
import math | ||
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ lib | ||
, python3 | ||
, python3Packages | ||
, fetchFromGitHub | ||
, substituteAll | ||
}: | ||
|
||
python3Packages.buildPythonApplication rec { | ||
pname = "tracepusher"; | ||
version = "0.9.0"; | ||
format = "setuptools"; | ||
|
||
disabled = python3.pythonOlder "3.11"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "agardnerIT"; | ||
repo = "tracepusher"; | ||
rev = version; | ||
hash = "sha256-OtdIIw6DxyTHZusuP3oJxxXJ4Ic0zoYQa805jHvh9oo="; | ||
}; | ||
|
||
patches = [ ./shebang.patch ]; | ||
|
||
postPatch = let | ||
setup = substituteAll { | ||
src = ./setup.py; | ||
desc = meta.description; | ||
inherit pname version; | ||
}; | ||
in '' | ||
ln -s ${setup} setup.py | ||
''; | ||
|
||
propagatedBuildInputs = [ | ||
python3Packages.requests | ||
]; | ||
|
||
doCheck = false; | ||
|
||
meta = with lib; { | ||
changelog = "https://github.com/agardnerIT/tracepusher/releases/tag/${version}"; | ||
description = "Generate and push OpenTelemetry Trace data to an OTEL collector in JSON format"; | ||
homepage = "https://github.com/agardnerIT/tracepusher"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ gaelreyrol ]; | ||
mainProgram = "tracepusher"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
import codecs | ||
import os | ||
from setuptools import setup, find_packages | ||
|
||
def open_local(paths, mode="r", encoding="utf8"): | ||
path = os.path.join(os.path.abspath(os.path.dirname(__file__)), *paths) | ||
return codecs.open(path, mode, encoding) | ||
|
||
with open_local(["requirements.txt"]) as req: | ||
install_requires = req.read().split("\n") | ||
|
||
setup(name='@pname@', | ||
version='@version@', | ||
description='@desc@', | ||
scripts=["tracepusher.py"], | ||
packages=find_packages(), | ||
install_requires=install_requires, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/tracepusher.py b/tracepusher.py | ||
index c23c526..e0490b4 100644 | ||
--- a/tracepusher.py | ||
+++ b/tracepusher.py | ||
@@ -1,3 +1,5 @@ | ||
+#! /usr/bin/env python | ||
+ | ||
import sys | ||
import requests | ||
import time |