Skip to content
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

max pk req addition & otel optimization #695

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
4 changes: 3 additions & 1 deletion tr_sys/tr_ars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,9 @@ def scrub_null_attributes(data):

def appraise(mesg, data, agent_name,retry_counter=0):
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
json_data = json.dumps(data)
CopyForMax = copy.deepcopy(data)
CopyForMax['pk']=str(mesg.id)
json_data = json.dumps(CopyForMax)
logging.info('sending data for agent: %s to APPRAISER URL: %s' % (agent_name, APPRAISER_URL))
with tracer.start_as_current_span("get_appraisal") as span:
try:
Expand Down
3 changes: 3 additions & 0 deletions tr_sys/tr_sys/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Configure broker retry on startup
app.conf.broker_connection_retry_on_startup = True

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

Expand Down
4 changes: 2 additions & 2 deletions tr_sys/tr_sys/otel_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from opentelemetry import trace
from opentelemetry.sdk.resources import SERVICE_NAME as telemetery_service_name_key, Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter, SimpleSpanProcessor
from opentelemetry.instrumentation.django import DjangoInstrumentor
from opentelemetry.exporter.jaeger.thrift import JaegerExporter
from opentelemetry.instrumentation.celery import CeleryInstrumentor
Expand Down Expand Up @@ -32,7 +32,7 @@ def configure_opentelemetry():
agent_port=jaeger_port,
)

span_processor = BatchSpanProcessor(jaeger_exporter)
span_processor = SimpleSpanProcessor(jaeger_exporter)
tracer_provider.add_span_processor(span_processor)

# Optional: Console exporter for debugging
Expand Down