Skip to content

Commit cecff47

Browse files
committed
add dbname to sql
1 parent b8d68b5 commit cecff47

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

create_function_toddog.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ declare
100100
begin
101101
name := 'sample.gauge';
102102
metric := 15;
103-
tag := 'source:plsql';
103+
tag := 'source:plsql' || ',dbname:' || sys_context('USERENV','DB_NAME');
104104
result := f_gaugetoddog(name,metric,tag);
105105
dbms_output.put_line(result);
106106
EXCEPTION
@@ -122,7 +122,7 @@ declare
122122
begin
123123
name := 'sample.count';
124124
metric := 15;
125-
tag := 'source:plsql';
125+
tag := 'source:plsql'|| ',dbname:' || sys_context('USERENV','DB_NAME');
126126
result := f_counttoddog(name,metric,tag);
127127
dbms_output.put_line(result);
128128
EXCEPTION
@@ -144,7 +144,7 @@ declare
144144
begin
145145
title := 'title of event';
146146
text := 'text for event';
147-
tag := 'source:plsql';
147+
tag := 'source:plsql' || ',dbname:' || sys_context('USERENV','DB_NAME');
148148
result := f_eventtoddog(title,text,tag);
149149
dbms_output.put_line(result);
150150
EXCEPTION

samples/rowcount.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ declare
1313
begin
1414
name := 'sample.rowcount';
1515
for t in c_table loop
16-
tag := 'table_name:' || t.table_name || ',schema:' || t.owner ;
16+
tag := 'table_name:' || t.table_name || ',schema:' || t.owner || ',dbname:' || sys_context('USERENV','DB_NAME');
1717
dbms_output.put_line(name || ':' || t.num_rows || ',' || tag);
1818
result := f_gaugetoddog(name,t.num_rows,tag);
1919
IF result != 'done' THEN

samples/rowcount_job.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
1313
begin
1414
name := 'sample.rowcount';
1515
for t in c_table loop
16-
tag := 'table_name:' || t.table_name || ',schema:' || t.owner;
16+
tag := 'table_name:' || t.table_name || ',schema:' || t.owner || ',dbname:' || sys_context('USERENV','DB_NAME');
1717
result := f_gaugetoddog(name,t.num_rows,tag);
1818
IF result != 'done' THEN
1919
RAISE errorinloop;

0 commit comments

Comments
 (0)