Skip to content

Commit fe6fc4b

Browse files
committed
update tag
1 parent 854c550 commit fe6fc4b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

create_function_toddog.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ declare
6464
begin
6565
name := 'sample.gauge';
6666
metric := 15;
67-
tag := 'plsql';
67+
tag := 'source:plsql';
6868
result := f_gaugetoddog(name,metric,tag);
6969
dbms_output.put_line(result);
7070
EXCEPTION
@@ -86,7 +86,7 @@ declare
8686
begin
8787
name := 'sample.count';
8888
metric := 15;
89-
tag := 'plsql';
89+
tag := 'source:plsql';
9090
result := f_counttoddog(name,metric,tag);
9191
dbms_output.put_line(result);
9292
EXCEPTION

samples/rowcount.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set serveroutput on
22

33
declare
44
name varchar2(50);
5+
tag varchar2(50);
56
result varchar2(10);
67
cursor c_table is
78
select TABLE_NAME, NUM_ROWS from all_tables where OWNER = 'HR';
@@ -11,7 +12,8 @@ declare
1112
begin
1213
name := 'sample.rowcount';
1314
for t in c_table loop
14-
result := f_gaugetoddog(name,t.num_rows,t.table_name);
15+
tag := concat('schema:hr,table_name:',t.table_name);
16+
result := f_gaugetoddog(name,t.num_rows,tag);
1517
IF result != 'done' THEN
1618
RAISE errorinloop;
1719
END IF;

samples/rowcount_job.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set serveroutput on
33
CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
44
name varchar2(50);
55
result varchar2(10);
6+
tag varchar2(50);
67
cursor c_table is
78
select TABLE_NAME, NUM_ROWS from all_tables where OWNER = 'HR';
89
errorinloop EXCEPTION;
@@ -11,7 +12,8 @@ CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
1112
begin
1213
name := 'sample.rowcount';
1314
for t in c_table loop
14-
result := f_gaugetoddog(name,t.num_rows,t.table_name);
15+
tag := concat('schema:hr,table_name:',t.table_name);
16+
result := f_gaugetoddog(name,t.num_rows,tag);
1517
IF result != 'done' THEN
1618
RAISE errorinloop;
1719
END IF;

src/toddog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ char *metrictoddog(
5050

5151
if (tag_i == OCI_IND_NULL)
5252
{
53-
asprintf(&themetric,"%s:%d|%s|#tag:notag",metricname, metric, thekind);
53+
asprintf(&themetric,"%s:%d|%s|",metricname, metric, thekind);
5454
}
5555

5656
if (tag_i == OCI_IND_NOTNULL)
5757
{
58-
asprintf(&themetric,"%s:%d|%s|#tag:%s",metricname, metric, thekind,tag);
58+
asprintf(&themetric,"%s:%d|%s|#%s",metricname, metric, thekind,tag);
5959
}
6060

6161
udp(8125, themetric);

0 commit comments

Comments
 (0)